NEWBIE: How to change app.config settings programatically?
Posted on 2006-06-06
I would like to allow my end-user to enter a value through my UI, and then place that value in an app.config. Specifically, I would like the user to type in a value for "MYDATABASE", and insert it below.
This is my app.config:
<?xml version="1.0" encoding="utf-8" ?>
connectionString="Data Source=MyBox;Initial Catalog=MYDATABASE;Persist Security Info=True;User ID=myUser;Password=myPassword"
What is the best way to do this with C#? (I'm on VS and MS SQL 2005).
BTW: Is this a bad thing to do? I don't want my users to have to figure out how to change app.config itself--given that I don't even know how yet...