I am using a direct connection string which is
string ConString = "Data source=.\\Sqlexpress; initial catalog=MyDB; integrated security=SSPI";
I need a connection string that is stored in web.config file like:
<connectionStrings>
<add name="SqlCon" connectionString="Data source=.\\Sqlexpress; initial catalog=MyDB; integrated security=SSPI" providerName="System.Data.SqlClient" />
</connectionStrings>
The problem with this is that it is not accessible in my Data Access Layer. I am working on 3 layer architecture model. I won't like adding references to my Data Access layer, such as System.Web etc. Every day my class libraries get more and more classes. I realize it is time to use a globally accessible connection string so that when I finally submit my project the connection string will need to be changed only at one place on the university computer.
System.Configuration.ConfigurationManager.ConnectionStrings["SqlCon"].ConnectionString