Transactions

T

thomson

Hi All,
Can any one tell me how would you do nested transaction in
Ado.net.
My situation is

I have opened a transaction

i have five records in a grid-

1
2
3
4
5

When i pass 1 it should be in a transaction, If it succeeds or failed ,
it should start with the next record

THanks in Advance



thomson
 
G

Grant Merwitz

Begin the transaction

Wrap all you updates/processing into a try statement.
Place the rollback in the Catch Statement
If an exception occurs the transaction is rolled back, or if a criteria you
have specified is not met,you simply throw an exception
If there is no exception, you commit the transaction

So within the Try statement, you just place your updates one after the other

Does that answer your question?
 

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

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top