I already added the reference System.Configuration and still, I get recieving that error. I am using VS2010. Here is the code
<configuration>
<connectionStrings>
<add name="MESConnection" connectionString="Server=.\SQLEXPRESS;Database=MES;Trusted_Connection=true"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Configuration.Install, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
</system.web>
and the code behind:
private static string _connStr = ConfigurationManager.ConnectionStrings["MESConnection"].ConnectionString;
Any ideas?