title: The parameterized query 'select ...' expects the parameter '@parameter', which was not supplied
body: <p>I am getting this error when trying to load the page only. The error is highlighted in bold.</p>
  
  <pre><code>string strConnectionString = "...";
  SqlConnection myConnect = new SqlConnection(strConnectionString);
  string strCommandText = "SELECT NRIC,Email,FirstName,LastName FROM Customer WHERE NRIC=@nric";
  SqlCommand cmd = new SqlCommand(strCommandText, myConnect);
  cmd.Parameters.Add("@nric", SqlDbType.NVarChar, 100);
  cmd.Parameters["@nric"].Value = (String)Session["CustomerNRIC"];
  myConnect.Open();
  
  SqlDataReader reader = cmd.ExecuteReader();
  </code></pre>
  
  <p>The error message is:</p>
  
  <blockquote>
    <p>The parameterized query '(@nric nvarchar(100))SELECT NRIC,Email,FirstName,LastName 
    FROM C' expects the parameter '@nric', which was not supplied. 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. Exception Details: System.Data.SqlClient.SqlException: The parameterized query '(@nric nvarchar(100))SELECT NRIC,Email,FirstName,LastName FROM C' expects the parameter '@nric', which was not supplied.</p>
  </blockquote>
  
  <p>My Customer TABLE </p>
  
  <blockquote>
    <p>GuestID             nvarchar(max) NRIC                nvarchar(50)
    FirstName           nvarchar(50) LastName            nvarchar(50)
    GuestAddress        nvarchar(50) GuestTelephone      nvarchar(50) DOB 
    nvarchar(50) Gender              nvarchar(50) Email<br>
    nvarchar(50)</p>
  </blockquote>