如何在不使用OLEDB的情况下将Excel文件导入到C#中的DataTable中 [英] How to import a Excel File into DataTable in C# without using OLEDB
本文介绍了如何在不使用OLEDB的情况下将Excel文件导入到C#中的DataTable中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在不使用OLEDB的情况下将Excel文件导入C#中的DataTable。我搜索谷歌但没有找到核心解决方案
How to import a Excel File into DataTable in C# without using OLEDB. I searched google but didn't find a corect solution
推荐答案
如果你不想使用OleDb那么一种方法是使用Interop并循环遍历数据床单。对于互操作,请查看 https:// msdn.microsoft.com/en-us/library/microsoft.office.interop.excel(v=office.15).aspx [ ^ ]和一个小教程,见http://www.dotnetperls.com/excel [ ^ ]
If you don't want to use OleDb then one way is to use Interop and loop through the data in the sheets. For interop, have a look at https://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel(v=office.15).aspx[^] and a small tutorial, see http://www.dotnetperls.com/excel[^]
这篇关于如何在不使用OLEDB的情况下将Excel文件导入到C#中的DataTable中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文