Exemplo n.º 1
0
        public static void ExecuteNoQuery(string procname, ref object model)
        {
            DbCommand dbcmd = db.GetStoredProcCommand(procname);

            dbcmd.CommandTimeout = 300;
            // 利用模型的值为存储过程出入口参数赋值(注:模型的值由客户端传递)
            ProcProxy.AddInParameterToDbCommand(procname, dbcmd, ref model);
            db.ExecuteDataSet(dbcmd);
            // 取得存储过程出口参数为模型赋值
            ProcProxy.GetOutParameterFromDbCommand(procname, dbcmd, ref model);
        }
Exemplo n.º 2
0
        public static DataSet ExecuteDataSet(string procname, object model)
        {
            DbCommand dbcmd = db.GetStoredProcCommand(procname);

            dbcmd.CommandTimeout = 300;
            // 为存储过程出入口参数赋值
            if (model != null)
            {
                ProcProxy.AddInParameterToDbCommand(procname, dbcmd, ref model);
            }
            return(db.ExecuteDataSet(dbcmd));
        }
Exemplo n.º 3
0
        public static DataSet ExecuteDataSet(string procname, ref object model)
        {
            DbCommand dbcmd = db.GetStoredProcCommand(procname);

            dbcmd.CommandTimeout = 300;
            // 为存储过程出入口参数赋值
            ProcProxy.AddInParameterToDbCommand(procname, dbcmd, ref model);
            DataSet dst = db.ExecuteDataSet(dbcmd);

            // 取得存储过程出口参数为模型赋值
            ProcProxy.GetOutParameterFromDbCommand(procname, dbcmd, ref model);
            return(dst);
        }