System.OutOfMemoryException将数据从数据集加载到Excel [英] System.OutOfMemoryException While loading data from dataset to Excel

查看:51
本文介绍了System.OutOfMemoryException将数据从数据集加载到Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好



我正在尝试将数据从数据集加载到excel表格这样的

Hello

I am trying to load data from dataset to excel sheet like this

Excel.ExcelPackage app = new Excel.ExcelPackage();
app.Workbook.Worksheets.Add("Sheet1").Cells["A1"].LoadFromDataTable(uploadDS.Tables[0], true);



这里我收到类似System.outofmemory异常的错误。



我上传到这样的数据集:


Here iam getting error like System.outofmemory exception.

I am uploading to dataset like this:

SqlDataAdapter uploadDA = new SqlDataAdapter(query, uploadCon);
 DataSet uploadDS = new DataSet("UploadDataset");
uploadDA.Fill(uploadDS);





感谢您的帮助。



Thanks for any help.

推荐答案

如何很多行和列你试图填入Excel? Excel无法容纳无限量的数据。您可能真的在运行机器内存不足或超出Excel可以在单页/工作簿中保存的数据量。
How many rows and columns are you trying to stuff into Excel?? Excel cannot hold an infinite amount of data. You probably really are running the machine out of memory or you're Exceeding the amount of data that Excel can hold in a single sheet/workbook.


过去我已经回答了类似的问题,请检查它出来了。

使用带有大量数据的.net数据表的最佳方式 [ ^ ]

同时检查这是否有excel限制

导出到Microsoft Excel [ ^ ]
In past I have answered similar question, check it out.
best way to use .net Datatable with a huge data[^]
Also check this for excel limitations
Exporting to Microsoft Excel[^]


这篇关于System.OutOfMemoryException将数据从数据集加载到Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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