SQLiteCommand1.Connection=SQLiteConnection1;
using (TransactionScope transScope = new TransactionScope()) {
SQLiteConnection1.Open();
SQLiteCommand1.ExecuteNonQuery();
transScope.Complete();
}
SQLiteConnection1.Close();
- or -
SQLiteCommand1.Connection=SQLiteConnection1;
SQLiteConnection1.Open();
using (TransactionScope transScope = new TransactionScope()) {
SQLiteConnection1.EnlistTransaction(Transaction.Current);
SQLiteCommand1.ExecuteNonQuery();
transScope.Complete();
}
SQLiteConnection1.Close();
- or -
CommittableTransaction cmtTx = new CommittableTransaction();
SQLiteConnection1.Open();
SQLiteConnection1.EnlistTransaction(cmtTx);
SQLiteCommand1.ExecuteNonQuery();
SQLiteConnection1.Close();