Are there any issues with concurrency on static methods creating instances
such as in the data access code below? Or if I wanted to expand it to use an
ADO.NET transaction and having two users access this method at the same time?
As I understand it, it would not be an issue because the variables being
referenced aren't static fields and are either created inside the method or
passed in.
In other words is there any real difference between this code executing
directly in a aspx codebehind vs in a static method of a class?.
public class Orders
{
public static void UpdateOrder(string value1, string value2, etc)
{
SqlConnection cn = new SqlConnection("connectionstring");
SqlCommand cmd = new SqlCommand("UpdateOrderStoredProc", cn);
...
cmd.ExecuteNonQuery();
}
}