SqlCommand.Transaction 属性

定义

获取或设置要在其中执行 SqlTransactionSqlCommand

public:
 property System::Data::SqlClient::SqlTransaction ^ Transaction { System::Data::SqlClient::SqlTransaction ^ get(); void set(System::Data::SqlClient::SqlTransaction ^ value); };
public System.Data.SqlClient.SqlTransaction Transaction { get; set; }
[System.ComponentModel.Browsable(false)]
[System.Data.DataSysDescription("DbCommand_Transaction")]
public System.Data.SqlClient.SqlTransaction Transaction { get; set; }
[System.ComponentModel.Browsable(false)]
public System.Data.SqlClient.SqlTransaction Transaction { get; set; }
member this.Transaction : System.Data.SqlClient.SqlTransaction with get, set
[<System.ComponentModel.Browsable(false)>]
[<System.Data.DataSysDescription("DbCommand_Transaction")>]
member this.Transaction : System.Data.SqlClient.SqlTransaction with get, set
[<System.ComponentModel.Browsable(false)>]
member this.Transaction : System.Data.SqlClient.SqlTransaction with get, set
Public Property Transaction As SqlTransaction

属性值

SqlTransaction 默认值是 null

属性

注解

如果属性已设置为特定值,并且命令正在执行中,则无法 Transaction 设置该属性。 如果将事务属性设置为 SqlTransaction 未连接到与 该对象相同的 SqlConnectionSqlCommand 对象,则下次尝试执行语句时将引发异常。

适用于

另请参阅