>>>>>不知是否能做到,在当前页中Select查出来的数据就只属于当前页的数据assume you are talking about SQL Server, you can use a stored procedure, seehttp://www.4guysfromrolla.com/webtech/062899-1.shtmlorhttp://www.15seconds.com/issue/010308.htm
or use "top" in a ugly way, for example6-10 records from authors in pubs:select * from (select top 5 * from (select top 10 * from authors order by au_lname) t order by au_lname desc) t2 order by au_lname

解决方案 »

  1.   

    http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=61NJ84S5-KSS5-4VDX-IMNP-KKQYLFS8US97
    http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=108B1516-53CE-4357-B061-17295AF9689F
      

  2.   

    请问楼主的是webForm还是winForm的?winForm的话是有方法的,我也做过。
      

  3.   

    你的办法是会很慢的,而且数据到本地了,会占用大量的内存,一般的表都有个用于唯一标识的字段,如ID什么的,我现在假设你的表就有这个字段,每次请求10条记录。SQL如下:
    select top pageIndex*10 * from tableName where id not in (select top (pageIndex-1)*10 ID from tableName)
    这个pageIndex在你的程序里换成你的页索引就OK了
    哦,忘了问你用的是什么数据库了,在ORACLE里是不支持top的,你要改用rownum(好象是的)。
      

  4.   

    我做的是WINFORM,是可行的,但是,刷新的时候就会有问题
      

  5.   

    哎呀,惨了,写错了,是WEBFORM
      

  6.   

    在SqlServer查询中加上Top的参数是可以的,
    在Oracle中加入对Rownum的判断也是可以的,
    但是在这里头会有一个头疼的问题,就是当你对所查询的结果进行排序的话,你没有对查出的结果进行排序与对查出的结果进行排序,这两个的显示顺序是大不一样的!!!
      

  7.   

    如果是winForm的话我倒是有个办法,速度也还可以。
      

  8.   

    select * from (select top pageIndex*10 * from tableName where id not in (select top (pageIndex-1)*10 ID from tableName)) A order by ID
    select top pageIndex*10 * from tableName where id not in (select top (pageIndex-1)*10 ID from tableName order by ID) order by ID
    上面只对查出的10条记录排序,下面对所有记录排序后再查出10条记录