C#通过Sql Data Base进行分页 [英] C # paging through Sql Data Base

查看:83
本文介绍了C#通过Sql Data Base进行分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我们都知道



一般网格浏览.net



ASP。 Net GridView获取所有记录,然后从提取的记录中显示一个页面。因此,例如,如果您的表有1000条记录,并且您需要每页只显示50条记录,GridView将获取丢弃950条记录的所有1000条记录,并根据用户选择的页面索引显示50条记录。



因此,就带宽和性能而言,上述方法效率很低。



使用自定义分页,我们将根据页面索引获取每页的记录,因为我们可以使用数据库中的ROW_NUMBER()方法。



我知道但是我对它没有更多的了解以及如何实现它所以请任何人给出并解释这种自定义分页的演示。



您的回复表示赞赏



提前致谢

Hi friends as we all know

in general gridview paging in .net

ASP.Net GridView fetches all the records and then displays one page from the fetched records. Thus for example if your table has 1000 records and you need to display only 50 records per page, GridView will fetch all 1000 records discard the 950 records and display the 50 records based on the page index selected by the users.

Thus the above approach is quite inefficient in terms of both bandwidth and performance.

With custom pagination we will fetch records per page based on the page index,for that we can use ROW_NUMBER() method from data base.

I know that but I have not more knowledge about it and how to implement it so any one please give and explain a demo for that kind of custom paging.

Your reply is appreciated

Thanks in advance

推荐答案

http://msdn.microsoft.com/en-us/library/bb445504.aspx [<一个href =http://msdn.microsoft.com/en-us/library/bb445504.aspxtarget =_ blanktitle =新窗口> ^ ]



检查此链接..希望它会有所帮助...
http://msdn.microsoft.com/en-us/library/bb445504.aspx[^]

check this link..hope it will help...


通过gridview的自定义分页检查这些文章..

GridView分页和排序 [ ^ ]

http://www.c-sharpcorner.com / UploadFile / rohatash / gridview-paging-sample-in-Asp-Net / [ ^ ]

http://sagarworld31.wordpress.com/2013/01/01/implement-custom-pagination -in-gridview-with-asp-net-with-c-4-0 / [ ^ ]

http://www.dotnetcurry.com/ShowArticle.aspx?ID=339 [<一个href =http://www.dotnetcurry.com/ShowArticle.aspx?ID=339target =_ blanktitle =新窗口> ^ ]

http://dotnetslackers.com/articles/gridview/Optimized-Paging-and -Sorting-in-ASP-NET-GridView.aspx [ ^ ]
Check these article over custom paging of gridview..
GridView Paging and Sorting[^]
http://www.c-sharpcorner.com/UploadFile/rohatash/gridview-paging-sample-in-Asp-Net/[^]
http://sagarworld31.wordpress.com/2013/01/01/implement-custom-pagination-in-gridview-with-asp-net-with-c-4-0/[^]
http://www.dotnetcurry.com/ShowArticle.aspx?ID=339[^]
http://dotnetslackers.com/articles/gridview/Optimized-Paging-and-Sorting-in-ASP-NET-GridView.aspx[^]


这篇关于C#通过Sql Data Base进行分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆