Is it good to save database connections in xml file

烂漫一生 提交于 2019-12-11 03:08:27

问题


I am on a general scenario of deploying my vb.net database application on my client's computer.

Thinking of future problem of changing the database connection setting, i am planning to store it in a normal xml file in the app directory so that where ever it is installed, in order to make database configuration i only need to make change to that file and my program runs smoothly.

So is this idea of storing database connection setting to xml config file in app directory or is there any other better idea?

I am planning it for vb.net winforms applications


回答1:


If you're using 2.0 or later, you can use a separate file to store general settings and separate them from what's on the main .config file, like:

<appSettings file="myotherfile.config" />

You can then update just that one file.

See this for more information.

Note that under ASP.NET, for web.config files, a change to the appSettings file does not trigger a reload of the whole web.config.



来源:https://stackoverflow.com/questions/5229445/is-it-good-to-save-database-connections-in-xml-file

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