日期:2014-05-17 浏览次数:20439 次
#region DataTable 分页
/// <summary>
/// 通用分页查询 DataTable
/// </summary>
/// <param name="pageSize">分页大小</param>
/// <param name="pageIndex">当前页码</param>
/// <param name="TableName">查询表名</param>
/// <param name="ColumnName">查询字段,逗号分割</param>
/// <param name="WhereStr">查询条件,不带where</param>
/// <param name="SelectOrder">排序字段</param>
/// <param name="OrderType">排序类型,0降序 1升序</param>
/// <returns></returns>
public static DataTable getDataTable(int pageSize, int pageIndex, string TableName, string ColumnName, string WhereStr, string SelectOrder, int OrderType)
{
string @TemStr;
string @TemOrder;
int @Pages = pageSize * (pageIndex - 1);
if (OrderType != 0)//判断排序
{
@TemStr = ">(SELECT MAX";