Re: ADO.NET Transaction



If it were me I would probably call a stored procedure that started the transaction ran all of the SPs, handled the exceptions, channeled the logic and returned success or failure via RETURN... but that's just me. I'm not a fan of client-side transactions...

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"Lit" <sql_agentman@xxxxxxxxxxx> wrote in message news:e0$W7bg2HHA.6072@xxxxxxxxxxxxxxxxxxxxxxx
Hello,

using ADO.NET 2.0, VS.NET 2005, SQL2005
I need to execute several Stored Procedures under one transaction. Can I use just one transaction or have to use multiple ( then commit or rollback all )
How does it work with ADO.NET

Ado.Tran
SP1 Called
loop
SP2 Called
SP3 Called
loop
SP4 Called
loop
Sp5 Called
Etc... etc...

if any error
rollback transaction ( or all transactions )
else
committe Transaction ( or all Transactions )

Thanks for any help or other Ideas

Lit





.



Relevant Pages

  • Re: transaction with unknown nbr of commands
    ... then call your wrapper stored procedure, passing it all of the user ... explicit transaction with a BEGIN TRAN statement, ... >When I run a sqlcommand in a transaction, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: rollback transaction not rolling back
    ... Mike ... ROLLBACK TRANSACTION ... If it finds an error in the loop I want it to ...
    (microsoft.public.sqlserver.programming)
  • RE: Database updating issue
    ... I started a transaction on the connection class, passed this to the dataadapter, invoked the Update method on the dataadapter and finally commit the transaction. ... try threading the these calls to the stored procedure. ... To accomplish this task, the inserting of all rows, at the moment, I'm using ...
    (microsoft.public.dotnet.framework)
  • Re: SQLServerException: The server failed to resume the transactio
    ... Are you doing transaction management in your stored procedure? ... Can you post your stored procedure defintion, ... If I remove the transaction management code from the proc then everything ... I'm preparing a CallableStatement at the start of the loop and I'm reusing ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Error Handling.
    ... BEGIN TRANSACTION statement inside of a stored procedure, ... server is less efficient and more prone to problems. ... Error handling in your sprocs is necessary for performance, ...
    (microsoft.public.sqlserver.clients)