将GridView导出到Excel导致System.OutOfMemoryException - ASP.NET VB [英] Export GridView to Excel cause System.OutOfMemoryException - ASP.NET VB

查看:84
本文介绍了将GridView导出到Excel导致System.OutOfMemoryException - ASP.NET VB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我想将GridView(25000条记录)导出到Excel。但是我得到了一条错误消息:System.OutOfMemoryException被抛出。


但是我需要将记录(甚至超过25000条记录)导出为ex​​cel


如何解决这个问题?

Hello everyone,

I want to export GridView (25000 records) to Excel. But i got an error message like : System.OutOfMemoryException was Thrown.

But i need to export the records (even more than 25000 records) to excel

How to solve this ?

推荐答案

大家好,


我想导出GridView(25000条记录)脱颖而出。但是我得到了一条错误消息:System.OutOfMemoryException被抛出。


但是我需要将记录(甚至超过25000条记录)导出为ex​​cel


如何解决这个问题?
Hello everyone,

I want to export GridView (25000 records) to Excel. But i got an error message like : System.OutOfMemoryException was Thrown.

But i need to export the records (even more than 25000 records) to excel

How to solve this ?


为什么不直接从数据库创建excel电子表格?为什么你需要创建一个长度为25000条记录的电子表格,电子表格的用途有多大?
Why don''t you create the excel spreadsheet directly from the database? Why would you need to create a spreadsheet that is 25000 records long, how useful is that spreadsheet going to be?


嗯,你试图加载的数据多于RAM。这就是为什么你会得到一个OutOfMemoryException。


此外,我认为这接近Excel的行限制。
Well, you''re trying to load more data than you have RAM. That''s why you would get an OutOfMemoryException.

Also, that is getting close to Excel''s row limit, I think.


这篇关于将GridView导出到Excel导致System.OutOfMemoryException - ASP.NET VB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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