Help! Multiple users using an app and sql queries getting mixed

  • Thread starter Thread starter REB
  • Start date Start date
R

REB

I have an asp.net application on a win2003 standard server using sql server
2000sp3 and I appear to be having some problems with updates/inserts getting
mixed when multiple users are on the system.

Here is what happened: My application is used to enter employee data, which
includes a list of all the employees previous employment (listed
chronologically on their application). I had two users entering this
previous employment data for 2 different drivers and somehow a save that one
user made from their workstation was inserted into the driver the other user
was currrently entering data for.

Does anyone have an idea as to how this can happen and what I need to do to
isolate the users sessions from each other?
 
I should have said in my first post, in case it is relevant, that the sql
query in question is contained in an user control that takes a parameter and
sets a static variable. The code looks like this:

//Declare a static in to store the driverId
private static int DriverNum;

//Call this to set the Driver ID

public void SetDriverID(int driver)

{

if(driver !=0)

{

DriverNum = driver;

Fill_DataGrid();

}

else

{

dgPreviousEmployers.DataBind();

//Clear all text boxes

txtReceivedDate.Text = "";

txtPrevEmp.Text = "";

txtFrom.Text = "";

txtTo.Text = "";

}

}

If my static variable is somehow being changed from another users session if
could account for my problem.
 
That static variable is the problem, look up the scope of static variables.

-John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top