OdbcConnection::BeginTransaction Method ()

 

Starts a transaction at the data source.

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

public:
OdbcTransaction^ BeginTransaction()

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.

System_CAPS_noteNote

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.

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

.NET Framework
Available since 1.1
Return to top
Show: