Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / March 2008

Tip: Looking for answers? Try searching our database.

Obtaining a List of Databases

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert E. Flaherty - 26 Mar 2008 16:00 GMT
I can use the SqlDataSourceEnumerator to get a list of SQL Server instances.
How do I obtain a list of databases in a given SQL Server instance?
Cowboy (Gregory A. Beamer) - 26 Mar 2008 16:56 GMT
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.

Signature

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!

*************************************************
>I can use the SqlDataSourceEnumerator to get a list of SQL Server
>instances.
> How do I obtain a list of databases in a given SQL Server instance?
William Vaughn [MVP] - 26 Mar 2008 18:08 GMT
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.

Signature

__________________________________________________________________________
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)
____________________________________________________________________________________________

>I can use the SqlDataSourceEnumerator to get a list of SQL Server
>instances.
> How do I obtain a list of databases in a given SQL Server instance?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.