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 物件,下次嘗試執行 語句時就會擲回例外狀況。

適用於

另請參閱