/// <summary> /// 摘要:对数据进行分页 /// </summary> /// <param name="dataSetSql">查询语句(包括列名、表等信息,支持表关联)</param> /// <param name="where">条件组,二维数据【0】为包括字段名的语句段模板,【1】为取值</param> /// <param name="orderByColumn">排序列,二维数据【0】为字段名,【1】为ASC(升序)或DESC(降序)</param> /// <param name="rowBegin">排序后数据集的行开始索引</param> /// <param name="rowEnd">排序后数据集的行结束索引</param> /// <returns></returns> public DataTable GetDataSet(string dataSetSql, List <string[]> where, List <string[]> orderByColumn, int rowBegin, int rowEnd) { DataTable dt = new DataTable(); string stTableName = string.Empty; try { T obj = (T)this.MemberwiseClone(); stTableName = ((TableAttribute)obj.GetType().GetCustomAttributes(true)[0]).TableName; IDBCore iDB = DBFactory.CreateDB(); /*if (DATABASE_TYPE == "XML") * { * iDB = new XMLCore(_TagData); * } * else * { * iDB = DBFactory.CreateDB(); * }*/ if ((rowBegin == -1 || rowEnd == -1) && orderByColumn != null) { dt = iDB.GetDataSet(dataSetSql, where, orderByColumn); } else if ((rowBegin == -1 || rowEnd == -1) && orderByColumn == null) { dt = iDB.GetDataSet(dataSetSql, where); } else { dt = iDB.GetDataSet(dataSetSql, where, orderByColumn, rowBegin, rowEnd); } } catch (Exception ex) { dt = null; throw ex; } return(dt); }