Transaction Property

MySQL Connector.Net

Collapse image Expand Image Copy image CopyHover image
Gets or sets the MySqlTransaction within which the MySqlCommand executes.

Namespace: MySql.Data.MySqlClient
Assembly: MySql.Data (in MySql.Data.dll) Version: 6.8.4.0

Syntax

C#
public MySqlTransaction Transaction { get; set; }
Visual Basic
Public Property Transaction As MySqlTransaction
	Get
	Set
Visual C++
public:
property MySqlTransaction^ Transaction {
	MySqlTransaction^ get ();
	void set (MySqlTransaction^ value);
}

Field Value

The MySqlTransaction. 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 a MySqlTransaction object that is not connected to the same MySqlConnection as the MySqlCommand object, an exception will be thrown the next time you attempt to execute a statement.

See Also