提升我的性能将数据导出到Excel [英] Advance my Performance exporting data to Excel
本文介绍了提升我的性能将数据导出到Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何让出口更快。
这个太慢..
解决方案
< blockquote>为了提高性能,您需要尽量减少使用Excel COM接口。
我建议先将对象列表转换为数据表,然后将其导出为excel ...
这是转换列表的通用方法< t>到数据表将列表转换为数据表 [ ^ ]
和这里是如何将它导出到Excel 使用XML [ ^ ]
如果从数据库中提取数据,导出数据的最快方法是使用 CopyFromRange() [ ^ ] MS Excel范围的方法。
更多关于:如何使用Visual C#2005或Visual C#.NET将数据传输到Excel工作簿 [ ^ ]
How can I make the export more faster.
this one is too slow..
解决方案
To improve performance you need to minimise the use of the Excel COM interface.
I would suggest converting your list of objects to a datatable first and then exporting that to excel ...
Here is a generic way to convert a list<t> to a datatable Converting a List to Datatable[^]
and here''s how to export it to Excel using XML[^]
If you fetching data from database, the fastest way to export data is to use CopyFromRange()[^] method for MS Excel range.
More about: How to transfer data to an Excel workbook by using Visual C# 2005 or Visual C# .NET[^]
这篇关于提升我的性能将数据导出到Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文