解决方案 »

  1.   

    就是分页查询,你到网上查 sql分页技术
      

  2.   

    分页不就搞定了,建议楼主用listview显示数据库的数据,listview+datapager就可以实现的
      

  3.   


    --数据库分页存储过程
    create    proc up_GetPagedArticel
    @pageIndex int =1,
    @author int,
    @pageSize int,
    @isDel int =0,
    @rowCount int output,
    @pageCount int output
    as 
    begin
    --1.总行数
    select @rowCount=COUNT(AId) from BlogArticle where AAuthor=@author and AIsDel=@isDel
    --2.根据总行数算出总页数
    set @pageCount=ceiling(@rowCount*1.0/@pageSize*1.0)
    --3根据页码查询文章
        select * from
        (select ROW_NUMBER() over(order by aid) as rowNum,* from BlogArticle where AAuthor=@author and AIsDel=@isDel) 
        as t  where t.rowNum >(@pageIndex-1)*@pageSize and t.rowNum<=@pageIndex*@pageSize
    end