DAAB : how to list the configured databases?

Topics: Data Access Application Block
Apr 25, 2009 at 10:14 AM
Hi,

Is there a way to obtain a collection of the databases configured in EntLib?

Thanx
Apr 27, 2009 at 4:24 AM
Hi,

There is no built-in function or method with in the Data Access Application Block but you can use the regular .NET code to enumerate the configured databases. Here is the code snippet:

            foreach (ConnectionStringSettings connString in System.Configuration.ConfigurationManager.ConnectionStrings)

            {

                Console.WriteLine(connString.Name);

            }


Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Apr 27, 2009 at 6:43 AM
Ok thank you for that !