/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }