all groups > dotnet ado.net > march 2008 >
You're in the

dotnet ado.net

group:

Obtaining a List of Databases


Obtaining a List of Databases Robert E. Flaherty
3/26/2008 8:00:13 AM
dotnet ado.net:
I can use the SqlDataSourceEnumerator to get a list of SQL Server instances.
Re: Obtaining a List of Databases William Vaughn [MVP]
3/26/2008 10:08:04 AM
There are factory classes that can return the list of servers and instances
given a specific provider. Once you have an instance (and the credentials to
connect) you can use ADO.NET GetSchema to populate every object visible to
the user--including the Databases. If you have SA rights, you'll be able to
see the databases in master. There is an example of all of this in the book.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
"Robert E. Flaherty" <RobertEFlaherty@discussions.microsoft.com> wrote in
message news:CB85824A-95F1-40D8-9C12-890316277BEE@microsoft.com...
[quoted text, click to view]
Re: Obtaining a List of Databases Cowboy (Gregory A. Beamer)
3/26/2008 10:56:35 AM
I have always used SQL DMO for enumerating both. You can also call
sp_databases on the master database for each server, but you will have to
have rights to call it.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
"Robert E. Flaherty" <RobertEFlaherty@discussions.microsoft.com> wrote in
message news:CB85824A-95F1-40D8-9C12-890316277BEE@microsoft.com...
[quoted text, click to view]

AddThis Social Bookmark Button