猪
不再找借口............
博客园
社区
首页
新随笔
联系
管理
订阅
随笔- 84 文章- 0 评论- 34
2009年9月1日
Linq分页
int pagesize = 3;
int pageindex = 0;
if (pageindex < 1)
{
pageindex = 1;
}
pageindex = Convert.ToInt32(Request.QueryString["pageindex"]) ;
DataClassesDataContext db = new DataClassesDataContext();
var sql = from test in db.test
orderby test.id ascending
select test;
this.GridView1.DataSource = sql.Skip((pageindex - 1) * pagesize).Take(pagesize);
this.GridView1.DataBind();
posted @ 2009-09-01 00:58 悟〈--觉 阅读(230) 评论(0)
编辑
公告