title: Need to iterate through SQL table rows, one at a time (table too big to use adapter.Fill)
body: <p>It's easy enough for me to read through a small SQL Server 2005 table like this:</p>
  
  <pre><code>string cmdText = "select * from myTable";
  SqlDataAdapter adapter = new SqlDataAdapter(cmdText, connection);
  DataTable table = new DataTable();
  adapter.Fill(table);
  </code></pre>
  
  <p>Unfortunately, this method appears to load the entire table into memory, which simply isn't going to work with the gigantic tables I'm working with.</p>
  
  <p>I would like to be able to iterate through the table one row at a time, such that only one row needs to be in memory at once. Something along the lines of:</p>
  
  <pre><code>foreach (DataRow row in rowIteratorObject)
  {
    // do something using the row
  
    // current row goes out of scope and is no longer in memory
  }
  </code></pre>
  
  <p>Kind of similar to the way you can use StreamReader to deal with a text file one line at a time, instead of reading it all in at once. Does anyone know of a way to do this with table rows (or, if I'm barking up the wrong tree, an alternative solution)?</p>