简体   繁体   中英

Better way to manage connection strings in visual studio?

I have multiple projects which connects to the same database through the connection-string, and they all have the same app.config data.

When, or if, I change my database I'm going to have to update all of these projects, and I will likely forget some which will make things very messy.

Is there a way to unify all these connection-strings to a single place to reduce complexity?

if your all application run on a single machine then what you are looking for is

ConfigurationManager.OpenExeConfiguration

it is the way of using a single exe configuration among multiple exe.

Hope this help you out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM