Hi guys
I am trying to access a connection string created in the web.config file of my project. Using:
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionStringNameFromWebConfig"].ConnectionString);
I am trying to access a connection string created in the web.config file of my project. Using:
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionStringNameFromWebConfig"].ConnectionString);
Problem is System.Configuration.ConfigurationManager is not recognised, I've added in 'using System.Configuration' at the top of my page which is greyed out because its not in use - apparently.
I've done some searching and most of what I found tells me to add the reference to the System.Configuration. This is where I am stuck, first of all I don't have a reference node (which I've read to right click on) but I can right click on the project node and there is an add reference option which I can click however there is nothing available to add. I've got tabs on the left - Projects, Shared Projects, both with a sub tab named solution and then I have browse with a sub tab recent. All are empty, am I meant to point Visual studio at a folder/file? Do I need to install something?
Im sure this should be an easy answer but I am once again stuck :-/
If you can help that would be greatly appreciated!
cheers
Dan
I've done some searching and most of what I found tells me to add the reference to the System.Configuration. This is where I am stuck, first of all I don't have a reference node (which I've read to right click on) but I can right click on the project node and there is an add reference option which I can click however there is nothing available to add. I've got tabs on the left - Projects, Shared Projects, both with a sub tab named solution and then I have browse with a sub tab recent. All are empty, am I meant to point Visual studio at a folder/file? Do I need to install something?
Im sure this should be an easy answer but I am once again stuck :-/
If you can help that would be greatly appreciated!
cheers
Dan