I would like to have several DB connection lines in the app.config file with the same server name. I use SlowCheetah to perform transforms based on various configurations. Here is what I now have that works great.
app.config contains:
<connectionStrings> <add name="Catalog1String" connectionString="TO BE REPLACED" providerName="System.Data.SqlClient" /> <add name="Catalog2String" connectionString="TO BE REPLACED" providerName="System.Data.SqlClient" /> </connectionStrings>
app.test-env.config contains:
<add name="Catalog1String" connectionString="Database=catalog1;Server=TestDbServer;Integrated Security=SSPI;Connection Timeout=60" xdt:Transform="Replace" xdt:Locator="Match(name)"/> <add name="Catalog2String" connectionString="Database=catalog2;Server=TestDbServer;Integrated Security=SSPI;Connection Timeout=60" xdt:Transform="Replace" xdt:Locator="Match(name)"/>
This works fine, but when I have a large number of these directories with the same server name, I have to change all of them. Not a big deal, but I'm wondering if there is a way to simplify it, so TestDbServer (and possibly connection timeouts, etc.) is the key somewhere in app.config.
Does anyone have any ideas?
source share