关于吴旗娃分页控件For mssqlserver版

yibin2006 2007-01-15 01:57:49
在演示页中看到有结合MS Sqlserver存储过程的分页
但存储过程在哪里?可以提供么?
...全文
199 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
szc21 2007-01-15
  • 打赏
  • 举报
回复
同顶
job_2006 2007-01-15
  • 打赏
  • 举报
回复
顶一下
jetsteven 2007-01-15
  • 打赏
  • 举报
回复

--分页,短消息。
CREATE PROCEDURE [a_mail_page]
(@pagesize int,
@pageindex int,
@docount bit,
@userid int,
@box int)
as
set nocount on
declare @indextable table(id int identity(1,1),nid int)
declare @PageLowerBound int
declare @PageUpperBound int

if(@box=1) --@box 1代表收件箱,@box 2代表发件箱
begin
if(@docount=1)
select count(mailid)
from vd_mailinbox
where touserid = @userid and touse=1 --fromuse=1表示没有删除
else
begin
set @PageLowerBound=(@pageindex-1)*@pagesize
set @PageUpperBound=@PageLowerBound+@pagesize
set rowcount @PageUpperBound
insert into @indextable(nid)
select mailid from vd_mailinbox
where touserid = @userid and touse=1 order by mailid desc
select O.mailid, O.crdate, O.username , O.remind, O.title
from vd_mailinbox O,@indextable t
where O.mailid=t.nid
and t.id>@PageLowerBound and t.id<=@PageUpperBound order by t.id
end
end
else
begin
if(@docount=1)
select count(mailid) from vd_mailOutbox
where fromuserid = @userid and fromuse=1 --fromuse=1表示没有删除
else
begin
set @PageLowerBound=(@pageindex-1)*@pagesize
set @PageUpperBound=@PageLowerBound+@pagesize
set rowcount @PageUpperBound
insert into @indextable(nid) select mailid from vd_mailoutbox where fromuserid=@userid and fromuse=1 order by mailid desc
select O.mailid, O.crdate, O.username , O.remind, O.title from vd_mailOutbox O,@indextable t where O.mailid=t.nid
and t.id>@PageLowerBound and t.id<=@PageUpperBound order by t.id
end
end

set nocount off
GO
潜水员2099 2007-01-15
  • 打赏
  • 举报
回复

http://www.webdiyer.com
下载!

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧