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

  • Thread starter Thread starter Rafi
  • Start date Start date
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
 
By explicitly creating a transaction.
xxxTransaction trans = xxxConnection.BeginTransaction;
....
See the help on BeginTransaction method.
 
Back
Top