title: Getting SqlDataAdapter and SqlCommand confused
body: <p>I've got this calling method:</p>
  
  <pre><code>public string RunReportSteps(int _reportKey) {
      DataTable fStepsTable;
      fStepsTable =  GetStepsTable("xxx.console.pr_xxx");
      return (string)fStepsTable.Rows[1][3];
  }
  </code></pre>
  
  <p>It calls this private method:</p>
  
  <pre><code>private DataTable GetStepsTable(string procName) {
      var connectionString = ConfigurationManager.ConnectionStrings["xxx"].ConnectionString;
      using(var conn = new SqlConnection(connectionString))
      using(var adapt = new SqlDataAdapter())
      using(var cmd = new SqlCommand(procName, conn)) {
  
          conn.Open();
  
          SqlParameter p = new SqlParameter("@ReportKey", this.ReportKey);
          p.Direction = ParameterDirection.Input;
          cmd.Parameters.Add(p);
          adapt.SelectCommand = cmd;
  
          DataSet mySet = new DataSet();
          adapt.Fill(mySet);     //&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;errors here
          return mySet.Tables[0];
      }
  }
  </code></pre>
  
  <p>Why am I getting the following error message?</p>
  
  <blockquote>
    <p>Procedure or function 'pr_xxx' expects parameter
    '@ReportKey', which was not supplied.</p>
  </blockquote>