title: Stored procedure or function expects parameter which wasn't supplied
body: <p>I am trying to execute a stored procedure in a <code>SqlCommand</code> in C#.</p>
  
  <p>This is the code in C#:</p>
  
  <pre><code>string s = ConfigurationManager.ConnectionStrings["connection"].ToString();
  SqlConnection conn = new SqlConnection(s);
  
  conn.Open();
  
  SqlCommand cmd = new SqlCommand("Signup1", conn);
  cmd.CommandType = CommandType.StoredProcedure;
  
  string password = TextBox2.Text;
  cmd.Parameters.Add(new SqlParameter("@email", email));
  
  SqlParameter pass = cmd.Parameters.Add("@password", SqlDbType.VarChar, 50);
  pass.Value = password;
  
  SqlParameter usertype = cmd.Parameters.Add("@usrtype", SqlDbType.VarChar, 50);
  usertype.Value =usertype.Value;
  
  cmd.ExecuteNonQuery();
  
  conn.Close();       
  </code></pre>
  
  <p>This is the stored procedure:</p>
  
  <pre><code>Create Proc Signup1
      @email varchar(20),
      @password Varchar(24),
      @usrtype Varchar(30)
  as
      Insert into Members(email, password)
      Values(@email, @password)
  
      if @usrtype = 'Normal User'
      begin
          Insert into Normal_Users(email)
          Values(@email)
      end
      else if @usrtype = 'Development Team'
      begin
          Insert into Development_Eeams(email)
          Values(@email)
      end
      else if @usrtype = 'Verified Reviewer'
      begin
          Insert into Verified_reviewers(email)
          Values(@email)
      end
      else
          raiserror('Invalid type',16,1)
  </code></pre>
  
  <p>When I execute the command I get this error </p>
  
  <blockquote>
    <p>Procedure or function 'Signup1' expects parameter '@password', which was not supplied.</p>
  </blockquote>
  
  <p>Though I did gave the procedure the value of the parameter, what is the solution? Thanks</p>