In Visual Studio 2010, you can use the web.config transforms to corral your connection strings. If you used the Web Application template, you should see that the Web.config is grouped with Web.Debug.config and Web.Release.config. When you publish, it uses your current configuration to determine which transform to use. For example...
In the Web.config, you can have all of the test connections set up
Code:
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="SQLServerConnectionString"
connectionString="Server=TestServer;Initial Catalog=TestDB;User ID=USERID;Password=PASSWORD"
providerName="System.Data.SqlClient"/>
</connectionStrings>
</configuration>
In the Web.Debug.config, you don't need to put anything in because it will use the base Web.config and it already uses test connections
In the Web.Release.config, you simply have the namespace in the configuration tag and then you make any customizations you need to make the connection string live.
Code:
<?xml version="1.0"?>
<configuration xmlns:xdt="[URL unfurl="true"]http://schemas.microsoft.com/XML-Document-Transform">[/URL]
<connectionStrings>
<add name="SQLServerConnectionString"
connectionString="Server=LiveServer;Initial Catalog=LiveDB;User ID=USERID;Password=PASSWORD"
providerName="System.Data.SqlClient"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
</configuration>
When you publish in Release mode, the example above will use the base web.config, then modify this connection string to produce the published web.config.
You can read more here:
msdn - config transforms. There are a lot of fancier things you can do than the quick example I put here.
One thing to note... the transform only happens when you publish. Hitting F5 in Visual Studio will use the base web.config in my experience.
Best of luck! I hope this helps out.
-Mark