我如何从一个ODBC连接可用表的列表? [英] How do I get a list of available tables from an ODBC connection?

查看:201
本文介绍了我如何从一个ODBC连接可用表的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Excel中我可以去数据 - >导入外部数据 - >导入数据...,然后选择要使用的数据源,然后在我提供的登录信息它给我的表的列表。我想知道如何编程获取该列表使用C#。

In Excel I can go to Data -> Import External Data -> Import Data... and then select the data source to use and then after I provide login information it gives me a list of tables. I would like to know how to get that list programmatically using C#.

推荐答案

什么类型的数据源,你询问? SQL Server的? ?访问

What type of data source are you interrogating? SQL Server? Access?

看看这些线:的 http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/bcf25d16-3ecd-427d-9ad2-57619d6b3691

对于OdbcConnection.GetSchema方法这里。此外文档:
http://msdn.microsoft.com/en-us/library/system.data.odbc.odbcconnection.getschema.aspx

Also documentation for the OdbcConnection.GetSchema Method here: http://msdn.microsoft.com/en-us/library/system.data.odbc.odbcconnection.getschema.aspx

这可能会为你工作:OdbcConnection.GetSchema(表格)

This may work for you: OdbcConnection.GetSchema("Tables")

-Krip

这篇关于我如何从一个ODBC连接可用表的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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