using System; using System.Data; using System.Collections.Generic; using System.Text; using Maticsoft.DBUtility; using System.Data.SQLite; namespace Jpsoft.DAL { public class BaseClass { /// /// 获得数据列表 /// /// 表名称 /// 查询列 /// 索引号 /// 页面大小 /// 查询条件 /// 排序 public DataSet SelectPage(string TableName, string Column, int PageIndex, int PageSize, string strWhere, string OrderBy) { StringBuilder strSql = new StringBuilder(); strSql.Append(string.Format("select {0} from {1} ", Column, TableName)); if (!string.IsNullOrWhiteSpace(strWhere)) { strSql.Append(" where " + strWhere); } if (!string.IsNullOrWhiteSpace(OrderBy)) { strSql.Append(" order by " + OrderBy); } strSql.Append(string.Format(" limit {0},{1}", PageSize * PageIndex, PageSize)); return DbHelperMySQL.Query(strSql.ToString()); } } }