开发者

Change connection string for all of projects in a solution

I hav开发者_Go百科e 2 projects in one solution. How can I change both connection string in one of them?


Have the connectionstring in one project and expose it by a method that returns the connectionstring. The other project references the first and uses that method at all places that require a connectionstring.

Be aware, that this only makes sence if both projects can be referenced logically. If not use a third project, that only contains the connectionstring and exposes it by such method.


What you probably need is a shared app.config and this can be done very easily with linked files within Visual Studio.

In the screenshot below you can see how it's done:

Change connection string for all of projects in a solution

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜