无需使用COM组件即可将数据从数据库导出到excel [英] Export data from database into excel without the use of COM components

查看:222
本文介绍了无需使用COM组件即可将数据从数据库导出到excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



任何人都可以指导如何在不使用COM组件(Interop.excel)的情况下将数据从数据库导出到excel ..
我正在专门寻找涉及OpenXml的方法,并且C#中需要代码.

谢谢

Hi,

Can anyone guide as to how to export data from database into excel without using COM components(Interop.excel)..
I am specifically looking for the method that involves OpenXml and the code is required in C#..


Thanks

推荐答案

您最好的选择是使用ADO.Net来访问数据库和excel电子表格. 此处 [ ^ ],您可以了解如何使用ADO.Net连接到excel.在提出问题之前,应该进行一些研究,并保留这些论坛,以便在遇到自己尝试过的问题时遇到特定的问题.
Your best bet would be to use ADO.Net to access both database and excel spreadsheet. Here[^] you can find out how to connect to excel with ADO.Net. You should do some research before you ask questions, and reserve these forums for when you have a specific problem with something you have tried yourself.


如果您以xml的形式查询结果,则可以使用xsl将结果转换为Excel.这篇文章"http://aspalliance.com/471_Convert_XML_To_an_Excel_Spreadsheet_Using_XSL.1"可能会帮助您将xml结果转换为excel.
If you are querying your result as xml, you can use xsl to convert your result to Excel. This Posting "http://aspalliance.com/471_Convert_XML_To_an_Excel_Spreadsheet_Using_XSL.1" may help you in transforming xml result to excel.


这篇关于无需使用COM组件即可将数据从数据库导出到excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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