当绑定超过50000条记录在gridview应用程序中被击中时 [英] When bind more than 50000 records in gridview application getting struck

查看:73
本文介绍了当绑定超过50000条记录在gridview应用程序中被击中时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我绑定超过5万条记录时,GridView的ASP.NET应用程序中的数据表被删除.请怎么解决呢?我正在为此GridView使用更新面板.

Hi,

When I am binding more than 50000 records datatable in gridview asp.net application getting struck. Please how to solve it? I am using update panel for this gridview.

推荐答案

您好,

首先,50000条记录?我非常怀疑任何用户都将使用这样的数据量.如果您仍然想显示这么多数据,请更改显示方式,例如使用摘要来显示需要显示的信息.

其次,我不知道为什么您不想使用分页,但您却说不这样做,所以没有分页.您只需要执行以下代码即可执行以下逻辑.
1.创建一个空数据集并将其绑定到gridview.
2.创建一个线程,该线程从数据库中分块读取数据并将其添加到数据集.如果数据库服务器存在于同一网络中,我建议一次记录1000-5000条记录.如果是通过Internet,则一次限制为500-1000.

要记住的一件事是,提取这么多的记录总是给网络,客户端计算机和数据库服务器带来压力.因此,如果要同时运行多个程序实例,则强烈建议使用缓存.

希望对您有所帮助
Hi there,

First things first, 50000 records?? I highly doubt any USER would make use of such amount of data. If you still want to show this much data, change the presentation, go for something like a summary that displays the information you need to show.

Secondly, I have no idea why you don''t want to use paging but you say you don''t, so no paging it is. You simply has to do code to perform the logic below.
1. Create a empty data set and bind it to the gridview.
2. Create a thread which reads data from the database in chunks and add to the dataset. I''d recommend 1000 - 5000 records at once if the database server exists in the same network. If it is over internet, limit to 500 - 1000 at once.

One thing to remember is that pulling this many records always puts stress on the network, client computer and the database server. So if there is going to be many instances of the program be running simultaneously, caching is highly recommended.

Hope this helps, regards


您可以尝试在网格中启用分页吗?
can you try enabling paging in grid?


这篇关于当绑定超过50000条记录在gridview应用程序中被击中时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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