将 Telerik radgrid 与自定义分页绑定时存储 900000 条记录的最佳方式
我正在 sharepoint 2010 中创建示例应用程序,我想在 telerik radgrid 中加载 900000 条记录,所以首先我将所有 900000 条记录存储在 viewstate 中,并从 viewstate 获取 50 条记录,并将其绑定到 radgrid 由于性能问题,但页面大小变得非常大,所以它抛出页面超时错误,之后我将 900000 条记录存储在 SPWeb 属性包中,而不是存储在 viewstate 中尽管它抛出了同样的错误,但任何人都可以帮助我。 我可以在哪里存储这些(900000)值而不会出现任何超时问题或性能问题,请帮助我
I am creating sample application in sharepoint 2010, i want to load 900000 records in telerik radgrid, so first i am storing all 900000 records in viewstate and get the 50 records from viewstate and bind it in radgrid due to the performance issue, but the page size goes to very huge, so it's throwing page timeout error, after that i store the 900000 records in SPWeb property bag instead of storing in viewstate eventhough it's throwing the same error, can anyone help me please.
where i can able to store those (900000) values with out any timeout issue or performance issue, please help me
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不想在视图状态中存储 900,000 条记录。这是对客户端和服务器资源的可怕浪费。而且,如果您的目标是自定义分页解决方案,则没有理由将所有信息存储在客户端。哎呀!
考虑阅读诸如 高效分页之类的文章通过大量数据。有点过时,但基本概念是合理的。查看您的查询,了解概念很重要。
You don't want to store 900,000 records in viewstate. It is a horrible waste of resources, both client and server. And, if you are aiming for a custom paging solution, there is no reason to store all of the information on the client side. Yuck!
Consider reading an article like Efficiently Paging Through Large Amounts of Data. A bit dated, but the basic concepts are sound. Looking at your query, getting the concepts down is important.
ViewState 并不是一个神奇的数据垃圾填埋场。它的目的是保存控件的状态信息,仅此而已。在某些情况下,人们会将其用于其他用途,但永远不应该将其用于存储大量数据。
至于您的问题,您需要实施某种类型的搜索或过滤系统来减少结果。不应该出现需要从数据库检索近 1,000,000 个结果的情况。
如果无法实现搜索,请使用分页并将行边界传递给存储过程,以便它仅返回当前页的结果。
以下是如何使用分页将结果限制为一页的快速示例:
您可以参考以下文章来获取有关上述内容的帮助:
http://www.asp .net/data-access/tutorials/efficiently-paging-through-large-amounts-of-data-vb
编辑
听起来此信息在任何情况下都不是特定于用户的方式,所以你也可以看看缓存数据,如下所示:
ViewState is not a magical landfill for data. It is intended to hold state information for controls, and that's it. There are circumstances where people use it for other things, but it should never, ever be used to store large chunks of data.
As for your question, you need to implement some type of search or filtering system to reduce your results. There shouldn't be any scenario where you need to retrieve almost 1,000,000 results from the database.
If you can't implement searching, then use pagination and pass row boundaries to the stored procedure, so it only returns results for the current page.
Here's a quick example of how to use paging to limit results to one page:
And here's an article you can refer to for help with the above:
http://www.asp.net/data-access/tutorials/efficiently-paging-through-large-amounts-of-data-vb
EDIT
It doesn't sound like this information is user-specific in any way, so you could also look into caching the data, like this: