This documentation is archived and is not being maintained.

OleDbCommand.Transaction Property

Gets or sets the OleDbTransaction within which the OleDbCommand executes.

[Visual Basic]
Public Property Transaction As OleDbTransaction
[C#]
public OleDbTransaction Transaction {get; set;}
[C++]
public: __property OleDbTransaction* get_Transaction();
public: __property void set_Transaction(OleDbTransaction*);
[JScript]
public function get Transaction() : OleDbTransaction;
public function set Transaction(OleDbTransaction);

Property Value

The OleDbTransaction. The default value is a null reference (Nothing in Visual Basic).

Remarks

You cannot set the Transaction property if it is already set to a specific value, and the command is in the process of executing. If you set the transaction property to an OleDbTransaction object that is not connected to the same OleDbConnection as the OleDbCommand object, an exception will be thrown the next time you attempt to execute a statement.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

OleDbCommand Class | OleDbCommand Members | System.Data.OleDb Namespace

Show: