示例#1
0
        /// <summary>
        /// 逐条执行查询命令(适用于存储过程的分页)
        /// </summary>
        /// <param name="storProcName">存储过程名称</param>
        /// <param name="cmdParms">参数集合</param>
        /// <param name="paging">Utility.Paging 分页属性</param>
        /// <returns>返回 List 实体集</returns>
        public List <T> DataTable <T>(string storProcName, SqlParameter[] cmdParms, ref Utility.Paging paging)
        {
            DataTable dt = Sql.DataTable(storProcName, cmdParms);

            return(ToEntity.ToList <T>(dt, ref paging));
        }
示例#2
0
        /// <summary>
        /// 逐条执行查询命令
        /// </summary>
        /// <param name="storProcName">存储过程名称</param>
        /// <returns>返回 List 实体集</returns>
        public List <T> DataTable <T>(string storProcName)
        {
            DataTable dt = Sql.DataTable(storProcName);

            return(ToEntity.ToList <T>(dt));
        }
示例#3
0
        /// <summary>
        /// 逐条执行查询命令
        /// </summary>
        /// <param name="storProcName">存储过程名称</param>
        /// <param name="cmdParms">参数集合</param>
        /// <returns>返回 List 实体集</returns>
        public List <T> DataTable <T>(string storProcName, SqlParameter[] cmdParms)
        {
            DataTable dt = Sql.DataTable(storProcName, cmdParms);

            return(ToEntity.ToList <T>(dt));
        }
示例#4
0
        /// <summary>
        /// 逐个执行SQL语句
        /// </summary>
        /// <param name="sqlString">SQL语句参数化</param>
        /// <param name="cmdParms">参数集合</param>
        /// <returns>返回 List 实体集</returns>
        public List <T> DataTableText <T>(string sqlString, SqlParameter[] cmdParms)
        {
            DataTable dt = Sql.DataTable(sqlString, cmdParms, CommandType.Text);

            return(ToEntity.ToList <T>(dt));
        }
示例#5
0
        /// <summary>
        /// 执行查询命令(向前只读)
        /// </summary>
        /// <param name="storProcName">存储过程名称</param>
        /// <returns>返回 List 实体集</returns>
        public List <T> ExecuteReader <T>(string storProcName)
        {
            DbDataReader dr = Sql.ExecuteReader(storProcName);

            return(ToEntity.ToList <T>((SqlDataReader)dr, true));
        }
示例#6
0
        /// <summary>
        /// 执行查询命令(向前只读)
        /// </summary>
        /// <param name="storProcName">存储过程名称</param>
        /// <param name="cmdParms">参数集合</param>
        /// <returns>返回 List 实体集</returns>
        public List <T> ExecuteReader <T>(string storProcName, SqlParameter[] cmdParms)
        {
            DbDataReader dr = Sql.ExecuteReader(storProcName, cmdParms);

            return(ToEntity.ToList <T>((SqlDataReader)dr, true));
        }
示例#7
0
        /// <summary>
        /// 逐个执行SQL语句
        /// </summary>
        /// <param name="sqlString">SQL语句参数化</param>
        /// <param name="cmdParms">参数集合</param>
        /// <returns>返回 List 实体集</returns>
        public List <T> ExecuteReaderText <T>(string sqlString, SqlParameter[] cmdParms)
        {
            DbDataReader dr = (SqlDataReader)Sql.ExecuteReader(sqlString, cmdParms, CommandType.Text);

            return(ToEntity.ToList <T>((SqlDataReader)dr, true));
        }