Share via


SqlTransaction.Connection Property

Definition

Gets the SqlConnection object associated with the transaction, or null if the transaction is no longer valid.

public:
 property Microsoft::Data::SqlClient::SqlConnection ^ Connection { Microsoft::Data::SqlClient::SqlConnection ^ get(); };
public Microsoft.Data.SqlClient.SqlConnection Connection { get; }
member this.Connection : Microsoft.Data.SqlClient.SqlConnection
Public ReadOnly Property Connection As SqlConnection

Property Value

The SqlConnection object associated with the transaction.

Remarks

A single application may have multiple database connections, each with zero or more transactions. This property lets you determine the connection object associated with a particular transaction created by BeginTransaction.

Applies to