예제 #1
0
        public static DataTable ProcessStoredProc(string storeProcName, IDataParameter[] param, string dbName)
        {
            IDbCommand        cmd    = Query.StoredProcCommand(storeProcName, param, dbName);
            PersistenceBroker broker = PersistenceBroker.Instance();

            return(broker.ExecuteQuery(cmd, dbName));
        }
예제 #2
0
        public static DataTable ExecuteSQLQuery(string strSQL, string dbName, int timeout)
        {
            PersistenceBroker broker = PersistenceBroker.Instance();
            IDbCommand        cmd    = broker.GetCommand(dbName);

            cmd.CommandText = strSQL;
            if (timeout >= 0)
            {
                cmd.CommandTimeout = timeout;
            }

            return(broker.ExecuteQuery(cmd, dbName));
        }
예제 #3
0
        public DataTable Execute()
        {
            StringWriter sql = new StringWriter();

            RenderSelect(sql);
            Assert.VerifyNotNull(sql, Error.NotNull);

            PersistenceBroker broker = PersistenceBroker.Instance();
            IDbCommand        cmd    = broker.GetCommand(m_ClassMap.Database.Name);

            cmd.CommandText = sql.ToString();
            DataTable dt = broker.ExecuteQuery(cmd, m_ClassMap.Database.Name);

            return(dt);
        }