Change a database connection string from code in asp.net
The connection string to a database should never be hard coded in your application. There is (almost) always a difference between the development and production database server. Besides that IT management should have an easy way to change the configuration.
Read more on the weblog of Peter van Ooijen