title: SQLDataReader Row Count
body: <p>I am trying to get the number of rows that were returned by iterating the reader. But I always get 1 when I run this code? Did I screw up something in this?</p>
  
  <pre><code>int count = 0;
  if (reader.HasRows)
  {
      while (reader.Read())
      {
          count++;
          rep.DataSource = reader;
          rep.DataBind();
      }
  }
  resultsnolabel.Text += " " + String.Format("{0}", count) + " Results";
  </code></pre>