数据类代码:
代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Reflection;
namespace DAL
{
public class UserManageClass
{
/// <summary>
/// 取得总页数
/// </summary>
/// <returns>总页数</returns>
public int GetPageCount()
{
int counts;
string SqlStr = "select count(0) from [User]";
counts = new SQLHelper().Content(SqlStr, CommandType.Text);
return counts;
}
/// <summary>
/// 取出每一页的内容
/// </summary>
/// <param name="SatrPage">开始页数</param>
/// <param name="EndPage">结束页数</param>
/// <returns>每一页的内容</returns>
public DataTable GetPageDate(string SatrPage, string EndPage)
{
DataTable dt;
string SqlStr = @"select * from
(select *, ROW_NUMBER() over(order by id)as no_ from [User])aa
where aa.no_ between '"+SatrPage+"' and '"+EndPage+"'";
dt = new SQLHelper().ExecuteQuery(SqlStr, CommandType.Text);
return dt;
}
/// <summary>
/// 将一个DataTable转换成列表
/// </summary>
/// <typeparam name="T">实体对象的类型</typeparam>
/// <param name="dt">要转换的DataTable</param>
/// <returns></returns>
新闻热点
疑难解答
图片精选