如何从Excel工作表中获取数据到VB.NET或C# [英] How to fetch data from an Excel sheet into VB.NET or C#

查看:69
本文介绍了如何从Excel工作表中获取数据到VB.NET或C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Friends,


我想从Excel工作表中获取数据到我的VB.NET应用程序中。我也希望看到数据自动刷新数据10秒我正在使用Visual Studio Web Developer 2010 Express。也帮助我以任何其他方式做同样的事情。

解决方案

亲爱的Rawat Bhupendra,


从Excel中获取数据的方法不止一种,例如通过VSTO,或者您可以使用microsoft ACE oledb提供程序。使用计时器,您可以以10秒的间隔提取数据。但是,如果文件未保存和/或仍在使用,则这些
都不起作用。我想说的是,如果文件被任何其他程序打开,那么你的程序; Windows会提示您出现访问冲突错误。


您尝试使用Excel文件是什么,为什么需要10秒间隔?为什么不在您的应用程序中使用DataGrid


请详细说明您的问题,以便我们为您提供更合适的答案。


哦和BTW,我相信你在错误的论坛。这不是VBA问题,而是VB.NET问题。


干杯,


John


 


Hello Friends,

I want to fetch data from an excel sheet into my VB.NET application.Also I want to see data such a way that it refresh automatically in 10 seconds. I am using Visual Studio Web Developer 2010 Express. Also help me to do the same thing in any other way.

解决方案

Dear Rawat Bhupendra,

There is more than one way to get data from Excel, for instance through VSTO or you can use the microsoft ACE oledb provider. Using a timer you can extract data at an interval of 10 seconds. However, if the file is not saved and / or still in use neither of these will work. What i'm trying to say is, if the file is opened by any other program then -your- program; windows will prompt you with an access violation error.

What is it that you are trying to do with the excel file, and why do you need a 10 second interval? Why not use a DataGrid in your application

Please elaborate your question so we can give you a more suitable answer.

Oh and BTW, i believe you are in the wrong forum. This is not a VBA question, but a VB.NET question.

Cheers,

John

 


这篇关于如何从Excel工作表中获取数据到VB.NET或C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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