如何使用C#引用(使用)excel表中的数据? [英] How to refer(use) the data in excel sheet using C# ?

查看:155
本文介绍了如何使用C#引用(使用)excel表中的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Excel工作表中有一些数据库。用c#编写的测试脚本在测试环境中运行。但是我想在测试脚本运行时访问excel表中的数据。可能吗?。如果您有任何意见,请分享。



我尝试过:



当前C#中的测试脚本正在运行。

I have some data base in excel sheet.A test script written in c# runs in a test environment. however i want to access the data in excel sheet when test script is running. is it possible?. please share if you have any input.

What I have tried:

currently test script in C# is working.

推荐答案

您可以将电子表格视为数据库中的表格:



Excel连接字符串 - ConnectionStrings.com [ ^ ]



连接字符串还有很多其他来源。< br $>


查找C#的ODBC和ADO连接对象。





一个提示我可以提供给你:如果电子表格中的数据布局得很好(比如数据库中的表格)而不是列表没有输入,那么效果会更好。

You can treat a spreadsheet like it was a table in a database:

Excel connection strings - ConnectionStrings.com[^]

There are many other sources for connection strings.

Look up C#'s ODBC and ADO connection objects.


One hint I can supply to you: this works much better if the data in the spreadsheet is laid out nicely (like a table in a database) and not as though columns weren't typed.


这篇关于如何使用C#引用(使用)excel表中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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