100分:谁会写vb.net的分页存储过程,以及调用分页方法(分可以再加)

chunfengdeyi 2005-09-13 05:40:55
谁会写vb.net的分页存储过程,以及调用分页方法

很急的 谁会呀救救我
...全文
120 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
chxuxu 2005-09-19
  • 打赏
  • 举报
回复
ding
Alden 2005-09-13
  • 打赏
  • 举报
回复
分页存储过程和vb没有关系吧,去数据库板块,搜一下一大把
helimin19 2005-09-13
  • 打赏
  • 举报
回复
分頁的存儲過程有很多寫法,具體使用何種就要看你的需求了
http://www.cnblogs.com/helimin19/articles/51080.html
helimin19 2005-09-13
  • 打赏
  • 举报
回复
相對於ADO.net來說VB是可以寫存儲過程的,不是寫的是如下形式:select * from tbName where PKID=@PKID
且這樣的存儲過程有很多限至-_-
chunfengdeyi 2005-09-13
  • 打赏
  • 举报
回复
up
ChengKing 2005-09-13
  • 打赏
  • 举报
回复
1.
http://dev.csdn.net/develop/article/72/72126.shtm

2.
引用:

CREATE procedure main_table_pwqzc
(@pagesize int,
@pageindex int,
@docount bit,
@this_id)
as
if(@docount=1)
begin
select count(id) from luntan where this_id=@this_id
end
else
begin
declare @indextable table(id int identity(1,1),nid int)
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=(@pageindex-1)*@pagesize
set @PageUpperBound=@PageLowerBound+@pagesize
set rowcount @PageUpperBound
insert into @indextable(nid) select id from luntan where

this_id=@this_id order by reply_time desc
select a.* from luntan a,@indextable t where a.id=t.nid
and t.id>@PageLowerBound and t.id<=@PageUpperBound order by t.id
end
GO

存储过程会根据传入的参数@docount来确定是不是要返回所有要分页的记录总


特别是这两行
set rowcount @PageUpperBound
insert into @indextable(nid) select id from luntan where

this_id=@this_id order by reply_time desc

真的是妙不可言!!set rowcount @PageUpperBound当记录数达到

@PageUpperBound时就会停止处理查询
,select id 只把id列取出放到临时表里,select a.* from luntan

a,@indextable t where a.id=t.nid
and t.id>@PageLowerBound and t.id<=@PageUpperBound order by t.id
chunfengdeyi 2005-09-13
  • 打赏
  • 举报
回复
我哦以前看过这个分页控件 好像是c#写的 在vb.net里面能用吗
webdiyer 2005-09-13
  • 打赏
  • 举报
回复
存储过程是sql语句编写的,现在还不能用vb.net来写存储过程,我的主页有个分页存储过程产生工具你可以试试:http://www.webdiyer.com

62,046

社区成员

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

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

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

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