OleDbConnection::BeginTransaction Method (IsolationLevel)

 

Starts a database transaction with the specified isolation level.

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

public:
OleDbTransaction^ BeginTransaction(
	IsolationLevel isolationLevel
)

Parameters

isolationLevel
Type: System.Data::IsolationLevel

The isolation level under which the transaction should run.

Return Value

Type: System.Data.OleDb::OleDbTransaction^

An object representing the new transaction.

Exception Condition
InvalidOperationException

Parallel transactions are not supported.

You must explicitly commit or roll back the transaction using the Commit or Rollback method. To make sure that the .NET Framework Data Provider for OLE DB transaction management model performs correctly, avoid using other transaction management models, such as those provided by the data source.

System_CAPS_noteNote

If you do not specify an isolation level, the default isolation level for the underlying provider is used. To specify an isolation level with the BeginTransaction method, use the overload that takes the isolationLevel parameter.

The following example creates an OleDbConnection and an OleDbTransaction. It also demonstrates how to use the BeginTransaction, a 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: