/// <summary> /// 分页获取数据列表 适用于SQL2005 /// </summary> /// <param name="SelectList">选取字段列表</param> /// <param name="tablename">数据源名称表名或视图名称</param> /// <param name="where">筛选条件</param> /// <param name="OrderExpression">排序 必须指定一个排序字段</param> /// <param name="pageindex">页索引 从0开始</param> /// <param name="pagesize">每页记录数</param> /// <returns></returns> public static DataTable GetDataByPager2005(string SelectList, string tablename, string where, string OrderExpression, int pageindex, int pagesize) { string cmd = "GetRecordFromPage"; SqlParameter[] para = new SqlParameter[6]; para[0] = new SqlParameter("@SelectList", SelectList); para[1] = new SqlParameter("@TableSource", tablename); para[2] = new SqlParameter("@SearchCondition", where); para[3] = new SqlParameter("@OrderExpression", OrderExpression); para[4] = new SqlParameter("@pageindex", pageindex); para[5] = new SqlParameter("@pagesize", pagesize); return(SqlHelper3.ExecuteDataset(connString, cmd, para).Tables[0]); }
/// <summary> /// 分页获取数据列表 适用于SQL2000 /// </summary> /// <param name="connectionString">连接字符串</param> /// <param name="fieldlist">查找的字段</param> /// <param name="tablename">表名</param> /// <param name="where">查询条件</param> /// <param name="orderfield">排序字段</param> /// <param name="key">主键</param> /// <param name="pageindex">页索引</param> /// <param name="pagesize">每页记录数</param> /// <param name="ordertype">排序方式 0=ASC 1=DESC</param> /// <param name="recordcount">总记录数</param> /// <returns></returns> public static DataTable GetDataByPager2000(string connectionString, string fieldlist, string tablename, string where, string orderfield, string key, int pageindex, int pagesize) { string cmd = "ProcCustomPage"; SqlParameter[] para = new SqlParameter[8]; para[0] = new SqlParameter("@tbname", tablename); para[1] = new SqlParameter("@FieldKey", key); para[2] = new SqlParameter("@WhereString", where); para[3] = new SqlParameter("@PageSize", pagesize); para[4] = new SqlParameter("@PageCurrent", pageindex); para[5] = new SqlParameter("@FieldOrder", orderfield); para[6] = new SqlParameter("@FieldShow", fieldlist); para[7] = new SqlParameter("@RecordCount", SqlDbType.Int); return(SqlHelper3.ExecuteDataset(connectionString, CommandType.StoredProcedure, cmd, para).Tables[0]); }
public static DataTable ExecuteProcedure(string procedureName, params SqlParameter[] para) { return(SqlHelper3.ExecuteDataset(connString, CommandType.StoredProcedure, procedureName, para).Tables[0]); }
public static DataTable ExecuteDataTable(string connectionString, string sql, params SqlParameter[] para) { return(SqlHelper3.ExecuteDataset(connectionString, CommandType.Text, sql, para).Tables[0]); }
public static DataTable ExecuteDataTable(string sql) { return(SqlHelper3.ExecuteDataset(connString, CommandType.Text, sql).Tables[0]); }