title: Trouble loading SQL Data Reader data into DataTable
body: <pre><code>string query = "select * from cfo_daily_trans_hist";
              try
              {
                  using (SqlConnection connection = new SqlConnection(
                         cnnString))
                  {
                      SqlCommand command = new SqlCommand(query);
                      command.Connection = connection;
                      connection.Open();
  
                      var result = command.ExecuteReader();
                      DataTable datatable = new DataTable();
                      datatable.Load(result);
                      connection.Close();
                  }
              }
  </code></pre>
  
  <p>So the <code>var result</code> is created through the <code>ExecuteReader();</code> and <code>HasRows</code> is <code>true</code>, and it shows the correct amount of fields. However, the <code>DataTable</code> that I create from it is empty.</p>
  
  <p>What am I doing wrong? I'm 99% sure it's getting data, but I don't know how to find it through the <code>SqlDataReader</code> object to make sure.</p>
  
  <p>Thanks.</p>