System.Data.SqlClient.SqlCommand.Transaction Property

Gets or sets the System.Data.SqlClient.SqlTransaction within which the System.Data.SqlClient.SqlCommand executes.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
public SqlTransaction Transaction { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

You cannot set the SqlCommand.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 System.Data.SqlClient.SqlTransaction object that is not connected to the same System.Data.SqlClient.SqlConnection as the System.Data.SqlClient.SqlCommand object, an exception is thrown the next time that you attempt to execute a statement.

Requirements

Namespace: System.Data.SqlClient
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0