Get all servers, databases, etc

G

Guest

Hi;

With the new ADO .NET 2.0, is there a way to have it enumerate all:
servers (of a given type such as Sql Server, Oracle, MySql, etc.)?
databases on a server?
tables, views, and stored procedures in a database?

I have database specific code (Oracle, Sql Server, & OLE-DB) to enumerate
the tables/view/stored procedures. But I would prefer a DbConnection based
call that would work for all.

And I have the Sql Server sqldmo code to get all Sql Server servers &
databases. But this requires the Sql Server client be installed, uses
unmanaged code, and only works for Sql Server.

??? - thanks - dave
 
K

Kevin Yu [MSFT]

Hi dave,

In ADO.NET 2.0, you can use System.Data.Sql.SqlDataSourceEnumerator class
to enumerate all the SQL server instances in the local network. It's newly
introduced in .NET framework 2.0. So SQLDMO is not necessary. However,
there is no build in classes to get other database instances. In SQL
server, we can use system stored procedures to get the databases, tables,
views and SP on a server. But we do not have a a common way to get these
from all kinds of db servers.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
H

Howard Hoffman

But, given a particular connection to a database instance, doesn't the
OleDbConnection.GetOleDbSchemaTable get you the rest?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top