C#三层中的分页

   最近写了一个winform的管理系统,里面的分页同学推荐了几种,感觉都不好用,比较麻烦,自己就找了一个比较简单的分页,利用数据存储过程来分页。

reate proc usp_User
@pageIndex Int=1,//页码默认值
@paGeSize INt=2//页容量默认值
AS
begin
select * from(select ROW_NUMBER() over(order by uid)AS rownum,* from dbo.LoginUser where ustate=1) as t
where t.rownum between @paGeSize *(@pageIndex-1)+1 and @pageIndex*@pageSize
End

调用存储过程

Exec usp_User 1,2

我认为用于winform中管理系统都比较实用,简单。

梦想,是一个目标,是让自己活下去的原动力,是让自己开心的原因。坚持!
原文地址:https://www.cnblogs.com/tandy/p/4635009.html