title: NullReferenceException trying to read connection string
body: <p>I have two projects. One is web &amp; the other is windows forms. Web project connects to database but the windows project throws an exception NullReferenceException reading the connection string.</p>
  
  <p>I am using the same classes to connect both projects. Connection is established using LINQTOSQL.</p>
  
  <p>Here is my Connection string:</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="GPSystemConnectionString"
           connectionString="Data Source=.;Initial Catalog=GPSystem;User ID=***;Password=***"
           providerName="System.Data.SqlClient" /&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>This is how i am reading it.</p>
  
  <pre><code>string CS = ConfigurationManager.ConnectionStrings["GPSystemConnectionString"].ConnectionString;
  </code></pre>
  
  <p>(Exception occurs on this line)..... (Object reference not set to an instance of an object.)</p>
  
  <p>Note: i am using same class to connect both projects.... one connects but the other fails.</p>
  
  <p>Please any one help me with this!</p>
  
  <p>Thank you in advance.</p>