在VB.NET中从Excel(* .xls,* .xlsx)导入数据 [英] Import Data From Excel (*.xls, *.xlsx) in VB.NET

查看:462
本文介绍了在VB.NET中从Excel(* .xls,* .xlsx)导入数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想使用VB.NET 2010将数据从Excel文件导入到DataGridView中。可能是.xls或.xlsx。



重要的是,在两种情况下,xls或xlsx类型的excel文件都必须执行相同的代码。



任何人都可以帮忙!



谢谢

Hi,

I want to import data from Excel file that may be .xls or .xlsx into DataGridView using VB.NET 2010.

The important thing is that the excel file either of xls or xlsx type in both cases the same code must do the same job.

Can anyone help !

Thanks

推荐答案

这个网站, http://www.connectionstrings.com/excel/ [ ^ ]非常棒,因为它是所有不同类型连接字符串的参考。



根据您使用的文件格式更改连接字符串,然后使用常规控件和ADO.Net来满足您的需要。
This site, http://www.connectionstrings.com/excel/[^], is great because it is a reference for all the different types of connection strings.

Just change the connection string depending on which file format you are using then use regular controls and ADO.Net to what you need to.


这篇关于在VB.NET中从Excel(* .xls,* .xlsx)导入数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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