AspNetPager分页存储过程
来源:互联网 发布:视频剪辑软件中文版 编辑:程序博客网 时间:2024/05/16 06:56
Alter procedure adminquestion //创建存储过程
(
@pagesize int, //分页大小
@pageindex int, //当前页数
@docount bit //true:返回数据量填充分页控件,false:返回数据填充数据显示控件
)
as
set nocount on
if(@docount=1) //返回数据量填充分页控件
Select count(questionid) FROM question
else
begin
declare @indextable table(questionid int identity(1,1),nid int) //定义虚拟表,包括int型的questonid字段初始值为1,自增1,已经int型的nid字段
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=(@pageindex-1)*@pagesize
set @PageUpperBound=@PageLowerBound+@pagesize
set rowcount @PageUpperBound //确定返回的数据量
insert into @indextable(nid) select questionid FROM question order by questionid desc //定义虚拟表
select O.NodeName,0.Score,O.total,O.state ,O.questionid,O.ptime ,case when len(title)>30 then left(title,28)+'...'else title end as title from question O,@indextable t where O.questionid=t.nid
and t.questionid>@PageLowerBound and t.questionid<=@PageUpperBound order by t.questionid //查找数据,返回给应用程序
end
set nocount off
(
@pagesize int, //分页大小
@pageindex int, //当前页数
@docount bit //true:返回数据量填充分页控件,false:返回数据填充数据显示控件
)
as
set nocount on
if(@docount=1) //返回数据量填充分页控件
Select count(questionid) FROM question
else
begin
declare @indextable table(questionid int identity(1,1),nid int) //定义虚拟表,包括int型的questonid字段初始值为1,自增1,已经int型的nid字段
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=(@pageindex-1)*@pagesize
set @PageUpperBound=@PageLowerBound+@pagesize
set rowcount @PageUpperBound //确定返回的数据量
insert into @indextable(nid) select questionid FROM question order by questionid desc //定义虚拟表
select O.NodeName,0.Score,O.total,O.state ,O.questionid,O.ptime ,case when len(title)>30 then left(title,28)+'...'else title end as title from question O,@indextable t where O.questionid=t.nid
and t.questionid>@PageLowerBound and t.questionid<=@PageUpperBound order by t.questionid //查找数据,返回给应用程序
end
set nocount off
- AspNetPager分页存储过程
- AspNetPager分页存储过程
- aspnetpager-分页-存储过程
- AspNetPager控件分页存储过程
- repeater+AspnetPager+存储过程分页
- 名校导航AspNetPager存储过程分页总结
- aspnetpager 分页存储过程的实现
- sqlhelper+aspnetpager+repeater存储过程分页
- aspnetpager 分页存储过程的实现
- aspnetpager 分页存储过程的实现
- Repeater+AspNetPager+存储过程实现分页
- AspNetPager的使用 1 (分页存储过程) AspNetPager 分页2(普通分页)
- 关于AspnetPager 分页控件 查询分页 存储过程 修改
- C#方法 Repeater、webdiyer:AspNetPager分页、存储过程分页
- aspnetpager 结合存储过程分页,加快访问速度
- AspNetPager与MSSQL海量分页存储过程结合
- aspnetpager和urlrewritingnet多参数分页(带存储过程)
- [原创]aspnetpager 分页存储过程的实现 全代码
- cmd命令大全
- 如何判断DropDownList中是否包含某个项
- 用C#把数据库中的记录按格式写入Word文档中
- 学生通讯管理系统
- 查看Linux文件目录的大小和文件夹包含的文件数
- AspNetPager分页存储过程
- ASP.NET操作Word文档
- vs2005导出excel、word
- 正则表达式经典教程
- 创建一个MDB文件
- 基于Ant+Velocity的简单代码生成器的思路与实现
- ARP病毒攻击不断危害升级 局域网该如何防范
- 经典JS 验证
- SQL语句导入导出大全