title: SqlDataReader vs SqlDataAdapter: which one has the better performance for returning a DataTable?
body: <p>I want to know which one has the better performance for returning a <code>DataTable</code>. Here for <code>SqlDataReader</code> I use <code>DataTable.Load(dr)</code></p>
  
  <p>Using <code>SqlDataReader</code>:</p>
  
  <pre><code>public static DataTable populateUsingDataReader(string myQuery)
  {
      DataTable dt = new DataTable();
      using (SqlConnection con = new SqlConnection(constring))
      {
          SqlCommand cmd = new SqlCommand(myQuery, con);
          con.Open();
          SqlDataReader dr = null;
          dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
          if (dr.HasRows)
          {
              dt.Load(dr);
          }
          return dt;
      }
  }
  </code></pre>
  
  <p>using <code>SqlDataAdapter</code>:</p>
  
  <pre><code>public DataTable populateUsingDataAdapter(string myQuery)
  {
      SqlDataAdapter dap = new SqlDataAdapter(myQuery,cn);
      DataSet ds = new DataSet();
      dap.Fill(ds);
      return ds.Tables[0];
  }
  </code></pre>