title: Attempt to retrieve Connection String from app.config throws NullReferenceException
body: <p>I tried to get appsetting from app config in my winform application (just a small project for study) but when i run my project, vs2013 throws an exception named "NullReferenceException"</p>
  
  <p>Although i have read this topic : <a href="https://stackoverflow.com/questions/27773236/how-to-get-connection-string-from-app-config-in-c-sharp">how to get connection string from app config in c#</a>
  And my code now is :</p>
  
  <blockquote>
    <p>SqlConnection bookcon = new SqlConnection(ConfigurationManager.AppSettings["MyConnection"].ToString());</p>
  </blockquote>
  
  <p>Im still receive the same exception, please tell me how to solve this problem?
  This is my appconfig file : </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
  &lt;appSettings&gt;
  &lt;add key="MyConnection" value="Data Source=HUYMANIT\\SQLEXPRESS;Initial Catalog=QLTV_1312240;Persist Security Info=True;User ID=sa;Password=123456"/&gt;
  &lt;/appSettings&gt;
  &lt;/configuration&gt;
  </code></pre>