Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a Solution Wide Connection String

Does anyone know if it is possible to create a single connection string that will be accessible to all the projects in a solution (we have about 6).

I can create a text file with this information, but we need design time support as well, and it is not practical to have a connection string in every App.Config and Web.config file in the solution.

We basically want a Single connection string that is easy to change should the location of the db change, that will also be used by the IDE for design time support

like image 982
Renier Avatar asked Apr 12 '10 09:04

Renier


1 Answers

Not sure, can't you just put a new config file to the solution items and include and load it in all projects?

Edit: I am specifically talking about a general (XML) config file, not an "App.config". Is has exactly the same format, it just goes by a different name. Add this file to your solution items and access it using OpenMappedExeConfiguration. You can find an additional example here.

like image 54
mafu Avatar answered Sep 20 '22 14:09

mafu