Enterprise Library Configuration RRS feed

  • Question

  • Hi....


    I have a project that's using the MS Enterprise Library, although unfortunately I'm not sure which version.


    Data access etc is all working fine. However, I would like to give users of a small windows app the ability to change the database connection.


    In the version of the Enterprise Library that I'm using, a connection is made by calling db.CreateDatabase(). This method reads from a config file called dataconfiguration.config, which has the following structure:


                <parameter name="database" value="ReferenceData" isSensitive="false" />
                <parameter name="Integrated Security" value="true" isSensitive="false" />
                <parameter name="server" value="SqlDev" isSensitive="false" />


    I would like the C# app to simply change the database and server name in this dataconfiguration.config file. Is there a way that this can be done in the Enterprise Library? Or is there a better way to achieve the user choosing their own connection settings in the app?


    Many thanks



    Saturday, August 11, 2007 7:17 PM


All replies

  • Hi,


    Can anyone help with this? Really causing me a few problems, so if anyone has any comments it would be appreciated


    Many thanks



    Monday, August 13, 2007 4:27 PM
  • I will not call it a configuration but just another feature of the Ent Lib because I used it and configured a standard data link property.  I have a complete tutorial and what you want to know is covered by Scott and there is a specific section for the Data Access Block with more code samples and tutorials.  Hope this helps.



    Monday, August 13, 2007 5:13 PM
  • Thanks - that was exactly what I needed to get it working!

    Tuesday, August 14, 2007 8:54 AM