OdbcConnection::BeginTransaction Method ()
Starts a transaction at the data source.
Assembly: System.Data (in System.Data.dll)
| Exception | Condition |
|---|---|
| InvalidOperationException | A transaction is currently active. Parallel transactions are not supported. |
To commit or roll back the transaction, you must explicitly use the Commit or Rollback methods.
To make sure that the .NET Framework Data Provider for ODBC transaction management model performs correctly, avoid using other transaction management models, such as those provided by the data source.
Note |
|---|
If you do not specify an isolation level, the isolation level will be determined by the driver being used. To specify an isolation level with the BeginTransaction method, use the overload that takes the isolevel parameter. |
The following example creates an OdbcConnection and an OdbcTransaction. It also demonstrates how to use the BeginTransaction, Commit, and Rollback methods.
Available since 1.1
