标题:分页控件加了查询条件应该怎么用
只看楼主
夜龙魂
Rank: 2
等 级:论坛游民
帖 子:130
专家分:65
注 册:2009-9-24
结帖率:57.14%
 问题点数:0 回复次数:2 
分页控件加了查询条件应该怎么用
with temptable as
(
    select row_number() over(order by cid ) rowid,* from customertable

)
    select * from temptable where rowid between 1(@pageStarIndex) and 1+2-1(@pageStarIndex+@pageSize-1)

这是没有查询条件的用法

但是我现在想加查询条件应该怎么用请大家帮忙我是这样写的不行
with temptable as
(
    select row_number() over(order by cid ) rowid,* from customertable

)
    select * from temptable where rowid between 1(@pageStarIndex) and 1+2-1(@pageStarIndex+@pageSize-1) and (clientitem='' or sinfoname='余露' or clientco='' or times='') order by times desc
搜索更多相关主题的帖子: 查询 条件 控件 
2009-11-16 10:10
冰弦冷瑟
Rank: 2
来 自:廊坊
等 级:论坛游民
威 望:1
帖 子:12
专家分:75
注 册:2009-10-31
得分:0 
分页控件(PagedDataSource)跟查询条件没有关系,查询方法返回的是一个List,分页控件是对这个List进行操作。所以SQL语句该怎么写还怎么写。
2009-11-16 14:10
冰彩虹
Rank: 4
来 自:上海
等 级:贵宾
威 望:14
帖 子:806
专家分:44
注 册:2007-6-28
得分:0 
查询条件应该加在:

with temptable as
(
    select row_number() over(order by cid ) rowid,* from customertable where ....
)
....

Flying without wings
2009-11-16 16:15



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-292445-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.244019 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved