开发者

Is it good to save database connections in xml file

I am on a general scena开发者_开发知识库rio 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜