public IDbTransaction BeginTransaction() { if (state != ConnectionState.Open) { throw new InvalidOperationException("Invalid operation: The connection is closed"); } SqliteTransaction t = new SqliteTransaction(); t.Connection = this; SqliteCommand cmd = (SqliteCommand)this.CreateCommand(); cmd.CommandText = "BEGIN"; cmd.ExecuteNonQuery(); return(t); }
public IDbTransaction BeginTransaction () { if (state != ConnectionState.Open) throw new InvalidOperationException("Invalid operation: The connection is closed"); SqliteTransaction t = new SqliteTransaction(); t.Connection = this; SqliteCommand cmd = (SqliteCommand)this.CreateCommand(); cmd.CommandText = "BEGIN"; cmd.ExecuteNonQuery(); return t; }