这可以用于方法的事务吗?我得到了读取/插入/更新ms访问的方法。
using (OleDbConnection conn = new OleDbConnection(ConnectionString)) {
OleDbCommand cmd = new OleDbCommand();
cmd.CommandText = "BEGIN TRANSACTION";
cmd.ExecuteNonQuery();
//C# code, methods etc where I put some values into db via OleDbCommand etc
cmd.Parameters.Clear();
cmd.CommandText = "COMMIT [TRANSACTION | WORK]";
cmd.ExecuteNonQuery();
//No idea what to put here..
cmd.Parameters.Clear();
cmd.CommandText = "ROLLBACK [TRANSACTION | WORK]";
cmd.ExecuteNonQuery();
}