SqlConfigurationSource & enterpriseLibrary.ConfigurationSource

Topics: Building and extending application blocks, Enterprise Library Core, General discussion
Jul 20, 2007 at 8:30 PM

I'm looking to implement a SqlConfigurationSource but don't know the app.config syntax for configuring the new source.

I understand that for a file the config section should look something like this below. What does it look like for Sql?

<enterpriseLibrary.ConfigurationSource selectedSource="fileSource">
<add name="fileSource" ....
filePath ="My.config" />
<add name="systemSource" ..../>

Jul 21, 2007 at 2:31 PM

This is the configuration used by the unit tests from the SqlConfigurationSource QuickStart

<enterpriseLibrary.ConfigurationSource selectedSource="sqlSource">
<add name="sqlSource" type="Microsoft.Practices.EnterpriseLibrary.SqlConfigurationSource.SqlConfigurationSource, Microsoft.Practices.EnterpriseLibrary.SqlConfigurationSource"
connectionString="server=(local)\SQLExpress;database=Northwind;Integrated Security=true"

However, the quickstart does implement design time support for this configuration, so you could use the tool instead (after deploying the binaries to the tool's folder).

Sep 21, 2007 at 10:54 AM
I changed the Enterprise library source code (added SqlConfigSrc) now I am having problems with signed assemblies :
What is the correct way of adding SqlConfigurationSource??

The only way I could get the SqlConfigurationSource to work was by adding a number of files from the SqlConfiguration quickstart into the EnterpriseLibrary source code, changing some files in the configuration-core of enterprise library (ConfigurationSourcesCommandregistrar to enable entlib to recognise the newly added configurationsource) and then rebuilding the entire Enterprise Library. This results in a list of new assemblies for the entire EnterpriseLibrary and none of the assemblies are signed; which is not ideal. Is there a better way of adding the SqlConfigurationSource??

I am also using DAAB so ended up using this patch http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=054e5e59-9d4e-4c83-ab5e-3b6ad9a6f4b6 (by A Kraus)

(someone please tell me the sqlconfigurationsource will be included in future EnterpriseLibrary releases?)