On this page
Enlists in the specified transaction.
Syntax
|
|---|
'Declaration
Public Overrides Sub EnlistTransaction( _
ByVal As Transaction _
) |
Parameters
- transaction
- A reference to an existing System.Transactions.Transaction in which to enlist.
Example
These samples demonstrate usage of
EnlistTransaction.
|
|---|
Google BigQueryCommand1.Connection=Google BigQueryConnection1;
using (TransactionScope transScope = new TransactionScope()) {
Google BigQueryConnection1.Open();
Google BigQueryCommand1.ExecuteNonQuery();
transScope.Complete();
}
Google BigQueryConnection1.Close();
- or -
Google BigQueryCommand1.Connection=Google BigQueryConnection1;
Google BigQueryConnection1.Open();
using (TransactionScope transScope = new TransactionScope()) {
Google BigQueryConnection1.EnlistTransaction(Transaction.Current);
Google BigQueryCommand1.ExecuteNonQuery();
transScope.Complete();
}
Google BigQueryConnection1.Close();
- or -
CommittableTransaction cmtTx = new CommittableTransaction();
Google BigQueryConnection1.Open();
Google BigQueryConnection1.EnlistTransaction(cmtTx);
Google BigQueryCommand1.ExecuteNonQuery();
Google BigQueryConnection1.Close(); |
|
|---|
Me.Google BigQueryCommand1.Connection = Me.Google BigQueryConnection1
Using transScope = New Transactions.TransactionScope
Me.Google BigQueryConnection1.Open()
Me.Google BigQueryCommand1.ExecuteNonQuery()
transScope.Complete()
End Using
Me.Google BigQueryConnection1.Close()
- or -
Me.Google BigQueryCommand1.Connection = Me.Google BigQueryConnection1
Me.Google BigQueryConnection1.Open()
Using transScope = New Transactions.TransactionScope
Me.Google BigQueryConnection1.EnlistTransaction(Transactions.Transaction.Current)
Me.Google BigQueryCommand1.ExecuteNonQuery()
transScope.Complete()
End Using
Me.Google BigQueryConnection1.Close()
- or -
Dim cmtTx As New Transactions.CommittableTransaction
Me.Google BigQueryConnection1.Open()
Me.Google BigQueryConnection1.EnlistTransaction(cmtTx)
Me.Google BigQueryCommand1.ExecuteNonQuery()
Me.Google BigQueryConnection1.Close() |
See Also