title: DataReader has rows and data, trying to read from it says "no data is present"
body: <p>I haven't used DataReaders in ages (I prefer to use an ORM) but I'm forced to at work.  I pull back the rows, and check that <code>HasRows</code> is true; debugging at this point and examining the reader shows that my data is there.</p>
  
  <p>Now here's the issue: the moment I call <code>reader.Read()</code>, trying to expand the results says "The enumeration yielded no results" or whatever, and I get the "Invalid attempt to read when no data is present." error.  I get the same thing if I don't call <code>Read()</code> (which is the default since the DataReader starts before the first record).</p>
  
  <p>I cannot remember the proper way to handle this; the data <strong>is</strong> there when I check <code>HasRows</code>, but is gone the moment I either try to read from it right after or after I call <code>Read</code>, which makes no sense as if I don't call <code>Read</code>, the reader should still be before the first record, and if the property is set that starts it at the first record (SingleRow?  I forget the name of it) is set, then I should be able to read rows without calling Read, however both ways seem to move <em>past</em> the row containing the data.</p>
  
  <p>What am I forgetting?  Code is fairly straightforward:</p>
  
  <pre><code>TemplateFile file = null;
  using (DbDataReader reader = ExecuteDataReaderProc("GetTemplateByID", idParam)) 
  { 
      if (reader.HasRows) // reader has data at this point - verified with debugger
      { 
          reader.Read(); // loses data at this point if I call Read()
          template = new TemplateFile 
          {
              FileName = Convert.ToString(reader["FileName"]) // whether or not I call
                                                              // Read, says no data here
          };
      }
  }
  </code></pre>