Suggest keeping 2 .config files just for your connection strings. Name them prod.db.config
and test.db.config
. Each has the <connectionStrings>
element with values specific to the environment that they're for.
The web.config has this element
<connectionStrings configSource="test.db.config">
Set the file properties for web.config as Build Action to None, once you're finished making changes to it. Take a copy of this, and deploy it to your application servers.
Whenever you're deploying releases, you're going to have to pay attention to configuration somehow. This strategy at least gives some visibility by filename on which connstring/database is being used in that environment.