如何使用datapager在listview中获得10个结果 [英] How to get 10 results only in listview with datapager
本文介绍了如何使用datapager在listview中获得10个结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有页面大小为10的datapager的listview,其中我列出了来自DB的数据。我注意到当使用数据分页器时,表中的整个结果都是通过查询获取并且它减慢了系统。如何实现获取只有前10个结果来自db然后使用分页接下来的10个结果等。请帮助
I have a listview with datapager with page size 10 in which i list data from DB.I have noticed when using data pager entire result from the table are taken by query and it slow downs the system.How can i achieve to get only first 10 result from db and then using paging next 10 results etc.Please help
推荐答案
嘿,你可以看看
使用ASP.NET中的列表视图控件进行有效分页 [ ^ ]
本文可以为您提供帮助。
Hey , you can take a look at
Effective paging with List View control in ASP.NET[^]
this article may help you.
要获取前6个记录,请使用top-n分析查询。
SELECT TOP 6列FROM tablename
To get only first 6 records use the top-n analysis query.
SELECT TOP 6 column FROM tablename
这篇关于如何使用datapager在listview中获得10个结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文