Custom source for connection strings

Topics: Data Access Application Block, Enterprise Library Core
Feb 27, 2007 at 4:53 PM
Has anyone else had this thought? The Data Access Block does very well with getting a connection string if that connection string is in the connectionStrings section of the configuration file. However, what if I want to use the data access block, but want to specify a different place for a connection string? (For example, from the registry)

Is this a feature that is in Enterprise Library 2.0? Is it something that would be useful for Enterprise Library 3.0?
Feb 27, 2007 at 6:38 PM
Enterprise Library supports this through the concept of Configuration Sources. While we don't have a registry-based Configuration Source, you could write one. We have a SQL Conifguration Source sample which you can look at for clues. One warning about this approach with respect to the DAAB is that even though the block will look in a custom configuration source for these settings, the default .NET ConnectionStrings class doesn't know about configuration sources and will always look in the application's default configuration file.

Feb 27, 2007 at 9:02 PM
Hi there. Thanks for the reply. Is there a specific place in the documentation or the code to look for this sample that you can point me to?

Feb 27, 2007 at 11:46 PM
It's in the start menu under Enterprise Library - January 2006\QuickStart Applications\SQL Configuration Source

Jun 20, 2007 at 8:30 PM
Is this still true with Enterprise Library 3.1?