Get connection string from Web.Config in n-tier application |
| Johann Montfort posted at 08-May-08 12:33 |
Dear All,
I have created an n-tier application, consisting of the UI, WCFService, ServiceLayer, and DAL. I want these to be independent of each other, since they can be moved on different servers.
Now in the DAL, I encountered a problem. how can I call the connection string from the Web.Config file? Normally, when the DAL is part of the whole project, I used to call it something like this:-
string strConnectionString = ConfigurationManager.AppSettings["ConnectionString"].ToString();
However now, the DAL is in a different project altogether. How can I reference this?
Your help is very much appreciated.
Thanks
Johann |
|