NullReferenceException when attempting to retrieve a connection string
<p>When I try</p>

<pre><code>var con = new SqlConnection(
                  ConfigurationManager
                  .ConnectionStrings["RegConnectionString"]
                  .ConnectionString);
</code></pre>

<p>I get the following error:</p>

<blockquote>
  <p>Error message-null reference exception
  object reference not set to an instance of an object</p>
</blockquote>

<p>What is going wrong?</p>
