DataSet Objects and Transactions

Many of the scenarios discussed so far in this chapter have involved transactions. Unfortunately, as of version 2.0 of the .NET Framework, the DataSet class does not offer support for transactions.

If you submit pending changes via a SqlDataAdapter, the SqlDataAdapter will implicitly call the AcceptChanges method on DataRow objects whose changes were submitted successfully. If the call to SqlDataAdapter.Update relied on a transaction (either a SqlTransaction or a System.Transaction) and you roll back the work performed on the transaction, the database will discard the changes you made during the transaction. The DataSet will not revert back to its state at the time the transaction began. However, there are a couple ...

Get Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.