OdbcConnection.BeginTransaction Method (IsolationLevel)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Starts a transaction at the data source with the specified IsolationLevel value.

Namespace:   System.Data.Odbc
Assembly:  System.Data (in System.Data.dll)

member BeginTransaction : 
        isolevel:IsolationLevel -> OdbcTransaction

Parameters

isolevel
Type: System.Data.IsolationLevel

The transaction isolation level for this connection. If you do not specify an isolation level, the default isolation level for the driver is used.

Return Value

Type: System.Data.Odbc.OdbcTransaction

An object representing the new transaction.

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.

The following example creates an OdbcConnection and an OdbcTransaction. It also demonstrates how to use the BeginTransaction, Commit, and Rollback methods.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: