We have a different set of connection strings in our config file as follows.
<!-- TEST CONNECTION STRING -->
<!--
<add name="fooConnection" connectionString="Data Source=Test_server;Initial Catalog=foo_dbTEST;User ID=foo_user;Password=abc1234;"/>
<add name="barConnection" connectionString="Data Source=Test_server;Initial Catalog=bar_dbTEST;User ID=bar_user;Password=abc1234;"/>
<add name="chewConnection" connectionString="Data Source=Test_server;Initial Catalog=chew_dbTEST;User ID=chew_user;Password=abc1234;"/>
-->
<!-- LIVE CONNECTION STRING -->
<add name="fooConnection" connectionString="Data Source=Live_server;Initial Catalog=foo_dbTest;User ID=fooTest_user;Password=abc1234;"/>
<add name="barConnection" connectionString="Data Source=Live_server;Initial Catalog=bar_Testdb;User ID=barTest_user;Password=abc1234;"/>
<add name="chewConnection" connectionString="Data Source=Live_server;Initial Catalog=chew_Test;User ID=chewTest_user;Password=abc1234;"/>
<!-- Local DEV CONNECTION STRING -->
<!--
<add name="fooConnection" connectionString="Data Source=MyDoombaPC;Initial Catalog=fooDEVdbTest;User ID=foouser;Password=abc1234;"/>
<add name="barConnection" connectionString="Data Source=MyDoombaPC;Initial Catalog=barDEVdb;User ID=barTestuser;Password=abc1234;"/>
<add name="chewConnection" connectionString="Data Source=MyDoombaPC;Initial Catalog=chewDEVdb;User ID=chewuser;Password=abc1234;"/>
-->
When I need to change from, for example, live to test I move the XML comments from the Test section to the live section. Is there a more elegant way of doing this using Visual Studio 2010?
Just to be clear this is not a requirement of the application once it is in production, this is for developers to switch between different database connection string sets.
How do others approach this?