title: Procedure or function .. expects parameter ... which was not supplied
body: <p>NOTE: Although I give it the same title, this is a distinctly different question from the <a href="https://stackoverflow.com/questions/19703653/stored-procedure-or-function-expects-parameter-which-is-not-supplied">original post</a> because it is a totally different cause of the error.  Hence, I supply different source code that causes the same error message, but under different circumstances.</p>
  <p>I have code that uses SqlClient to execute a stored procedure, and am getting this every time I run it.</p>
  <pre><code>SqlConnection connString = new SqlConnection (&quot;Data Source = (LocalDb) \\ MSSQLLocalDB; Initial Catalog = codadb; Integrated Security = True&quot;);
  connString.Open();
                      
  var command = connString.CreateCommand();
  command.CommandText = &quot;[coda].[ACCOUNT_ADD_NEW]&quot;;
  
  command.Parameters.AddWithValue(&quot;@accountNameParam&quot;, &quot;Test&quot;);
  command.Parameters.AddWithValue(&quot;@emailParam&quot;, &quot;test@abc.com&quot;);
  var acctid = new SqlParameter(&quot;@accountidParam&quot;, SqlDbType.BigInt);
  acctid.Direction = System.Data.ParameterDirection.Output;
  command.ExecuteNonQuery ();
  long acct_idnum = Convert.ToInt64(acctid.Value);
  connString.Close ();
  </code></pre>