Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nested Transactions
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00708456
Message ID:
00708461
Views:
10
Doug,

Are you using the CommandBuilder to generate the Update and Insert statements?

>I am trying to get nested transactions to work using 2 sql command objects
>
>SqlTransaction myTrans = SqlConn.BeginTransaction();
>
>HeaderCmd = poh.InsertCommand;
>HeaderCmd.Transaction = myTrans;
>
>if(poh.UpdateInsertdata(HeaderCmd, Header))
>{
>     DetailsCmd = pod.InsertCommand;
>     DetailsCmd.Transaction = myTrans;
>
>     if(pod.UpdateInsertData(DetailsCmd, Details))
>        GoodTrans= true;
>}
>if(GoodTrans)
>    myTrans,Commit();
>else
>    myTrans.Rollback();
>
>
>Both of these command share the same transaction.
>
>I am forcing an error to occur during the detail portion of the code. But when I hit
>myTrans.Rollback() I am greeted with:
>
>The ROLLBACK TRANSACTIOn request has no corresponding BEGIN TRANSACTION.
>
>Anyone have a clue?
>
>Doug
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform