Hello
I am using my.settings to create a application scope connection string.
The customer would like to change this if they want to connect to another database, and this should update the app.config file with the updated connection string.
My problem I have into the setting and create a connection string (easy). But I don't know and can't find out to update and save the new connection string.
My.Settings.cnnString = "This is example connection" 'Error read-only property
I am using .net 2005
Can anyone help,
I got this code and it seem it would work. However, there is a problem with the code. I get a "Object reference not set to an instance of an object."
Here my code.
Thanks in advance,Code:Dim config As Configuration.Configuration = Configuration.ConfigurationManager.OpenExeConfiguration(Configuration.ConfigurationUserLevel.None) config.ConnectionStrings.ConnectionStrings("ServiceMasterConnectionString").ConnectionString = "This is new connection " 'Error - config.Save()
Steve




Reply With Quote