Пример #1
0
        public int ExecuteNonQuery(qGen.IStatementOrQuery statementOrQuery)
        {
            if (this.ReadOnly)
            {
                throw new InvalidOperationException("No se pueden realizar cambios en la conexión de lectura");
            }

            if (statementOrQuery is qGen.Update || statementOrQuery is qGen.Insert || statementOrQuery is qGen.Delete)
            {
                if (this.RequiresTransaction && this.m_InTransaction == false)
                {
                    throw new InvalidOperationException("Comando fuera una transacción.");
                }
            }

            using (var Cmd = this.Factory.Formatter.SetupDbCommand(statementOrQuery, this)) {
                return(this.ExecuteNonQuery(Cmd));
            }
        }
Пример #2
0
 public System.Data.IDbCommand GetCommand(qGen.IStatementOrQuery command)
 {
     System.Data.IDbCommand TempCommand = this.Factory.Driver.GetCommand();
     TempCommand.Connection = this.DbConnection;
     return(this.Factory.Formatter.SetupDbCommand(command, this));
 }