I have a three tier set-up. Someone suggested I should get the ConnectionString from the Web.Config file and I've got it set up like this:
Now I'm trying to access the ConnectionString from my DAL tier, but I can't find the ConfigurationManager. How can I invoke my Connection string from here?:
Add a reference to System.Configuration
, then have a using class for System.Configuration
, then you will have access to:
ConfigurationManager.ConnectionStrings
And yours can be accessed via
string s = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With