Rollback with ado.net

  • Thread starter Thread starter RA
  • Start date Start date
R

RA

Hi

I am updating tables using the dataadapter update method.
Lets day that when I am updating table1 all goes well, so then I go to
update table2 and it fails. How can I rollback table1?


Thanks,
Ron
 
Ron,

William is right, a Transaction will help you bundle your
changes into a single atomic unit.

Keep in mind that the DataSet is not "aware" of the
transaction. If you need to revert the DataSet back to its state
at the start of the transaction, your best bet is to copy the
contents of the DataSet to a variable or write the contents of
the DataSet to a temporary file.

I hope this information proves helpful.

David Sceppa
Microsoft
This posting is provided "AS IS" with no warranties,
and confers no rights. You assume all risk for your use.
© 2003 Microsoft Corporation. All rights reserved.
 
David:

A bit off topic, but as the biggest fan of your book..I was wondering if
there is a second edition or another one on ADO.NET planned?
 
William,

Thank you for the kind words. I'm hopeful that we'll have a
second edition with additional material to cover the new features
in the next release of the Framework.

David Sceppa
Microsoft
This posting is provided "AS IS" with no warranties,
and confers no rights. You assume all risk for your use.
© 2003 Microsoft Corporation. All rights reserved.
 
Me too. ;)

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top