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();