共用方式為


SqlCommand.Transaction 屬性

定義

取得或設定 SqlTransaction 執行的內部 SqlCommand

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與該SqlCommand物件不連結的SqlConnection物件,下次執行敘述時會拋出例外。

適用於

另請參閱