c# - Object reference not set to an instance of an object
<pre><code>sUsername.Trim();
sPassword.Trim();
string ConnectionString = WebConfigurationManager.ConnectionStrings["dbnameConnectionString"].ConnectionString;
SqlConnection myConnection = new SqlConnection(ConnectionString);
</code></pre>

<blockquote>
  <p>Object reference not set to an instance of an object.
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p>
  
  <p>Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.</p>
</blockquote>

<p>Any ideas? I don't understand the error.</p>
