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