Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Nested Transactions
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00708456
Message ID:
00708469
Vues:
9
Cathi,

Yes I am.

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
Consultant and Development Director
Prenia Software & Consulting Services
Microsoft MVP
cgero@prenia.com
www.prenia.com
www.foxcentral.net
Douglas Osborne
Don't spend your life just wishing - http://www.AllGiftRegistry.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform