如何从c#中将.xltm文件中的数据读取/提取到数据集中 [英] How to read/extract data from .xltm file in c# into a dataset

查看:128
本文介绍了如何从c#中将.xltm文件中的数据读取/提取到数据集中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从c#中将.xltm文件中的数据读取/提取到数据集中



至于.xls和.xlsx我们使用

Provider = Microsoft.ACE.OLEDB.12.0; Data Source =+ flg.FileName +; Extended Properties ='Excel 8.0; HDR = Yes;'

我们可以轻松获得来自两个扩展的数据。

但现在我想从.xltm中提取数据



请帮助我。

How to read/extract data from .xltm file in c# into a dataset

As for .xls and for .xlsx we use
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + flg.FileName + ";Extended Properties='Excel 8.0;HDR=Yes;'"
and we can easily get data from both extensions.
But now i want to extract data from .xltm

Please help me.

推荐答案

您将需要使用Excel Interop程序集,它是Microsoft Office API的一部分。有关使用Excel Interop程序集的大量文章/示例。这是微软的一个应该可以帮助你入门:



如何:使用Visual C#功能访问Office互操作对象(C#编程指南)
You will need to use the Excel Interop assembly which is part of the Microsoft Office API. There are plenty of articles/samples on using the Excel Interop assembly. Here is one from Microsoft which should help you get started:

How to: Access Office Interop Objects by Using Visual C# Features (C# Programming Guide)


这篇关于如何从c#中将.xltm文件中的数据读取/提取到数据集中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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