How To Change The Connection String saved in My.Settings in VB 2010

折月煮酒 提交于 2019-12-06 01:33:51
CoderDennis

Here's how to edit the setting via code:

My.Settings.Item("ConnectionString") = "some connection string"

However, an easier solution would be to just use the app.config file. When the wizard creates your DataSets it should be adding the connection strings to app.config, which will get copied to your project's output directory as <assemblyName>.config. Then your installer could determine the proper connection string and edit the .config file automatically. Also, your users could edit the config file manually.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!