This class encapsulates a client-initiated database transaction. If you have an open connection, you can start a transaction by calling the OleDbConnection.BeginTransaction( ) method, which returns an OleDbTransaction object. The OleDbTransaction class implements the System.Data.IDbTransaction interface, and its members are described in that section of the reference.

You can also use the Begin( ) method to start a nested transaction (a transaction within the bounds of another transaction). This returns a second OleDbTransaction instance, which can be used to manage the nested transaction. The actions in the nested transaction can be committed or rolled back independently; however, if you roll back the parent transaction, the actions in the nested transaction are also rolled back (even if you committed the nested transaction).

public sealed class OleDbTransaction : MarshalByRefObject, System.Data.IDbTransaction, IDisposable {

// Public Instance Properties

   public OleDbConnection Connection{get; } 

   public IsolationLevel IsolationLevel{get; }                 // implements System.Data.IDbTransaction

                  // Public Instance Methods

   public OleDbTransaction Begin( );  

   public OleDbTransaction Begin(System.Data.IsolationLevel isolevel);

   public void Commit( );                                       // implements System.Data.IDbTransaction

   public void Rollback( );                                     // implements System.Data.IDbTransaction

                  // Protected Instance Methods

   protected override void Finalize( );                         // overrides object



System.Object System.MarshalByRefObject ...

Get ADO.NET in a Nutshell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.