Enlists in the specified transaction.
These samples demonstrate usage of
EnlistTransaction.
ZohoBooksCommand1.Connection=ZohoBooksConnection1;
using (TransactionScope transScope = new TransactionScope()) {
ZohoBooksConnection1.Open();
ZohoBooksCommand1.ExecuteNonQuery();
transScope.Complete();
}
ZohoBooksConnection1.Close();
- or -
ZohoBooksCommand1.Connection=ZohoBooksConnection1;
ZohoBooksConnection1.Open();
using (TransactionScope transScope = new TransactionScope()) {
ZohoBooksConnection1.EnlistTransaction(Transaction.Current);
ZohoBooksCommand1.ExecuteNonQuery();
transScope.Complete();
}
ZohoBooksConnection1.Close();
- or -
CommittableTransaction cmtTx = new CommittableTransaction();
ZohoBooksConnection1.Open();
ZohoBooksConnection1.EnlistTransaction(cmtTx);
ZohoBooksCommand1.ExecuteNonQuery();
ZohoBooksConnection1.Close();
Me.ZohoBooksCommand1.Connection = Me.ZohoBooksConnection1
Using transScope = New Transactions.TransactionScope
Me.ZohoBooksConnection1.Open()
Me.ZohoBooksCommand1.ExecuteNonQuery()
transScope.Complete()
End Using
Me.ZohoBooksConnection1.Close()
- or -
Me.ZohoBooksCommand1.Connection = Me.ZohoBooksConnection1
Me.ZohoBooksConnection1.Open()
Using transScope = New Transactions.TransactionScope
Me.ZohoBooksConnection1.EnlistTransaction(Transactions.Transaction.Current)
Me.ZohoBooksCommand1.ExecuteNonQuery()
transScope.Complete()
End Using
Me.ZohoBooksConnection1.Close()
- or -
Dim cmtTx As New Transactions.CommittableTransaction
Me.ZohoBooksConnection1.Open()
Me.ZohoBooksConnection1.EnlistTransaction(cmtTx)
Me.ZohoBooksCommand1.ExecuteNonQuery()
Me.ZohoBooksConnection1.Close()