Question: > 
> **Possible Duplicate:**  
> 
> [VS2005 C# Programmatically change connection string contained in app.config](https://stackoverflow.com/questions/63546/vs2005-c-sharp-programmatically-change-connection-string-contained-in-app-config) 
> 
> 
> 

I have created a WinForms project in my PC using C#, and would like to deploy the project to other pc's, but I need to change the connection string in the app.config in order to connect the sql sever database in other pc's, and I want the users to configure the connection string. 

How can I accomplish this?

Answer: 
You can tell the users to edit the app.config, or you can provide a UI and use the ConfigurationManager to edit the app.config at runtime.

[Edit app config at runtime](http://itsmebhavin.wordpress.com/2012/02/08/edit-app-config-at-runtime-c/)

[Update app.config system.net setting at runtime](https://stackoverflow.com/questions/980440/update-app-config-system-net-setting-at-runtime)
Modify the app config from code.
<http://chiragrdarji.wordpress.com/2008/09/25/how-to-change-appconfig-file-run-time-using-c/>