title: "Procedure or function has too many arguments specified" But It Doesn't
body: <p>Thank you ahead of time for your help.  It is much appreciated.</p>
  
  <p>After two long hours of scouring Stack Overflow and other Google results for the reason that I am getting a "Procedure or Function has too many arguments specified," I have found no useful help.  The reason for this is that everywhere, I read that I probably either have too many arguments specified, the incorrect names for my arguments, or the incorrect types.  None of these are true to my case.  Here is my code:</p>
  
  <pre><code>CREATE PROCEDURE dbo.sproc_UpdateInfo 
  
  (
  @Name nvarchar(40),
  @UserId varchar(50),
  @Password varchar(50),
  @Address nvarchar(120)
  )
  
  AS
  Update tbl_Users SET Name=@Name, Password=@Password, Address=@Address WHERE UserId=@UserId
  
  
  RETURN
  </code></pre>
  
  <p>And here is the C# side of things:</p>
  
  <pre><code>SqlCommand sqlCmd = new SqlCommand();
  sqlCmd.CommandText = "sproc_UpdateInfo";
  sqlCmd.CommandType = CommandType.StoredProcedure;
  
  sqlCmd.Parameters.Add("@Name", SqlDbType.NVarChar, 40).Value = name;
  
  sqlCmd.Parameters.Add("@UserId", SqlDbType.VarChar, 50).Value = userID;
  sqlCmd.Parameters.Add("@Password", SqlDbType.VarChar, 50).Value = password;
  sqlCmd.Parameters.Add("@Address", SqlDbType.NVarChar, 120).Value = address;
  
  SqlConnection sqlConn = new SqlConnection(connectionString);
  
  sqlCmd.Connection = sqlConn;
  
  try
  {
      sqlCmd.Connection.Open();
  
      int rowaffected = sqlCmd.ExecuteNonQuery(); //Error occurs here
      return rowaffected;
  }
  catch (SqlException se)
  {
      throw new Exception("SqlException: sqlstr=" + sqlCmd.CommandText, se);
  }
  finally
  {
      sqlCmd.Dispose();
      sqlConn.Close();
  }
  </code></pre>