将GridView绑定到具有超过400000条记录的数据表时发生System.OutOfMemoryException [英] System.OutOfMemoryException when binding a gridview to a datatable having more then 400000 records

查看:95
本文介绍了将GridView绑定到具有超过400000条记录的数据表时发生System.OutOfMemoryException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

在将网格视图与具有超过400000条记录的数据表绑定时,我面临着system.outofmemmory异常,请为同一
查找以下示例代码 GridView gv =新的GridView();
this.EnableViewState = false;
gv.DataSource =(DataTable)dt;
gv.DataBind();

请帮助我克服这种情况下,databind的gridview是否有任何限制?

Dear,

I am facing system.outofmemmory exception when binding a gridview with a datatable having more then 400000 records please find the below sample code for the same
GridView gv = new GridView();
this.EnableViewState = false;
gv.DataSource = (DataTable)dt;
gv.DataBind();

Kindly help me to overcome in this situation is there any limitation of gridview for databind?

推荐答案

asp.net的gridview中的400000条记录!!!并希望将其显示给您的用户!
我认为您必须重新考虑自己在做什么.我不确定浏览器是否支持此数据量.
我认为最好将其拆分为页面.
400000 records in gridview in asp.net!!!! and you want to show it to your user!!
I think you have to reconsider what you are doing.I am not sure if the browsers support this volume of data.
I think it is better to split it in pages.


datatable having more then 400000 records please


这是在网格中显示数据的好方法.不,仅在网格上,我会在任何地方说.您是否考虑过页面的性能?以及如何处理您的400000数据.尝试使用过滤器,仅显示需要的数据.不要去显示如此大量的数据.


This is good way show the data in grid. Not, only on grid, I will say anywhere. Did you think about the performace of the page ? And what to do you 400000 data at time. Try to use filter and show only those data which needed. Don''t go for showing this amount of huge data.


这篇关于将GridView绑定到具有超过400000条记录的数据表时发生System.OutOfMemoryException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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