title: SqlDataAdapter filling with DataTable does not work
body: <p>I have this code running in form_load event:</p>
  <pre><code>        using (SqlConnection sqlConn = new SqlConnection(strConn))
          {
              sqlConn.Open();
              SqlDataAdapter sqlDa = new SqlDataAdapter(&quot;pp_sp_MachineAndOp&quot;, sqlConn);
              DataTable sqlDt = Helper.ExecuteDataTable(&quot;pp_sp_MachineAndOp&quot;, new SqlParameter(&quot;@MachineAndOpID&quot;, 7));
              sqlDa.Fill(sqlDt);
              dgvMachineAndOp.AutoGenerateColumns = false;
              dgvMachineAndOp.DataSource = sqlDt;
  
              sqlDa.Dispose();
              sqlConn.Close();
  
          }
  </code></pre>
  <p>I get error <em>'Procedure or function 'pp_sp_MachineAndOp' expects parameter '@MachineAndOpID', which was not supplied.'</em> at line:</p>
  <pre><code>                sqlDa.Fill(sqlDt);
  </code></pre>
  <p>Important to say that if I open DataTable Visualizer of sqlDt at runtime I see expected results!</p>
  <p><a href="https://i.stack.imgur.com/1HRtD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1HRtD.png" alt="" /></a></p>
  <p>Here is a code behind Helper.ExecuteDataTable:</p>
  <pre><code>        public static DataTable ExecuteDataTable(string storedProcedureName, params SqlParameter[] arrParam)
      {
          DataTable dt = new DataTable();
  
          // Open the connection 
          using (SqlConnection sqlConn = new SqlConnection(strConn))
          {
              try
              {
                  sqlConn.Open();
                  // Define the command 
                  using (SqlCommand sqlCmd = new SqlCommand())
                  {
                      sqlCmd.Connection = sqlConn;
                      sqlCmd.CommandType = CommandType.StoredProcedure;
                      sqlCmd.CommandText = storedProcedureName;
  
                      // Handle the parameters 
                      if (arrParam != null)
                      {
                          foreach (SqlParameter param in arrParam)
                          {
                              sqlCmd.Parameters.Add(param);
                          }
                      }
  
                      // Define the data adapter and fill the dataset 
                      using (SqlDataAdapter da = new SqlDataAdapter(sqlCmd))
                      {
                          da.Fill(dt);
                      }
                  }
              }
              catch (SqlException ex)
              {
                  MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
              }
  
          }
          return dt;
      }
  </code></pre>
  <p>What I am missing?</p>