How to force DA.Update to run in a single transaction ?

R

Rafi

hi,

i have a dataset with many changes (mostly insert) and a dataadapter
that configuerd to use stored procedures for insert, update, delete.
when using DA.update it works fine.
but, i find out that if there is a problem in the 10th record, i
recieve an exception but all previous changes are done.

i would like to have the entire changes under DA.update to be in a
single transaction so i can rollback the entire batch.

how it can be done ?

thanks
 
M

Miha Markic [MVP C#]

By explicitly creating a transaction.
xxxTransaction trans = xxxConnection.BeginTransaction;
....
See the help on BeginTransaction method.
 

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

Top