Hello everyone, I have 2 projects in one solution. How can I change both connection string in one of them?
+1
A:
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.
citronas
2010-08-18 06:53:01
A:
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:
Jochen
2010-08-18 06:56:00
How can I do it by code?
baran
2010-08-18 07:00:48
Can you make your question more clear? Do you have 2 exe's that need to share the same connectionstring? And you only want to configure it once?
Jochen
2010-08-18 07:24:48