Reading Connection string from application Config file
<p>I am trying to read a connection string from the application configuration file.</p>

<p>But keep receiving an error:</p>

<blockquote>
  <p>The name ConfigurationManager does in exit in current context.</p>
</blockquote>

<p>After googling the error, I added ConfigurationManager to my project. But I still get the same error.</p>

<p>My code:</p>

<pre><code>string sqlConStr = ConfigurationManager.ConnectionStrings["AppConnectionString"].ToString();`    
</code></pre>

<p>My application config file:    </p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration&gt;
    &lt;connectionStrings&gt;
        &lt;add name="AppConnectionString" connectionString="SERVER=1894; Database=db; UID=loss;  PWD=where;encrypt=no;enlist=false" providerName="System.Data.SqlClient" /&gt;
    &lt;/connectionStrings&gt;
&lt;/configuration&gt;
</code></pre>
