المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : C# SqlTransaction



C# Programming
02-15-2013, 05:25 AM
Hy guys...

I am facing a serious problem, with c# sqlTransaction,

The thing is, i have about 7 different tables that i execute a single transactions against(with a their autoIncrement IDs), which works fine for a single user when trying to insert new record... now the problem started when 10 users were capturing the information together and sometimes do concurent transections where the first user submits the form and the transaction starts(e.g at ID 1001), and user number 2 (few seconds after the 1st user) submits as well and get the second(1002) for the 1st and 2nd table, but for some reason(network signal maybe) 1st user insert is slow and and 2nd user's signal(speed) is faster and then the 2nd user ends up getting the 1st ID of the 3rd and the rest of the tables and the 1st user will get the second ID that was assigned to the 2nd user in the 1st 2 tables........

i think the problem here is the isolation mode which i didn't(or couldn't) set for the insert query to prevent the concurent insertion...

If i'm wrong please kindly correct me.

Now what i'm asking is you guys to help me control this...

The languages i'm using is/are..

1.c# in Visual studio 2010
2.Ms sql server 2008 r2
3. and asp.net...

I'd really appreciate ur help...

I'm sorry about the grama, English is not my home languege. thank you in advanve