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