NEWBIE: How to change a ConnectionString?
Posted on 2006-06-02
I have an existing ConnectionString, and I want to change the database it points to. Is there a clean way to do that in C# without actually parsing the String manually? Like, can the "database" part of the String be accessed like it was an Object in it's own right?
I currently have:
With this value:
Data Source=myMachine;Initial Catalog=myDatabase;Persist Security Info=True;User ID=myUserID;Password=myPassword
Is there any kind of method like:
If not, what does everybody do?