title: How to indicate the current progress of querying a large dataset?
body: <p>I want to use progress bar to show the current progress % the rows of data have been loaded.  I see <a href="https://stackoverflow.com/questions/5135650/show-progress-of-filling-a-dataset-from-mysql">similiar question</a> has been asked in SO, but the solution is just suggest using marquee style.</p>
  
  <p>For example, I run a Select statement that query a large data table which might take few seconds.
  I want the progress bar update the current progress of the query.  Is that possbile?</p>
  
  <p>I know there is few things I need:</p>
  
  <ol>
  <li>A count of total records will be retrieving.  (Can obtain by Select count(1) first)</li>
  <li>Some notificiation to tell how many records I just retrieved.</li>
  </ol>
  
  <p>For 2. is the part I don't know how to implement.</p>
  
  <p>I can think of split it into couples query, but this may not be possible all the time.</p>
  
  <p>But how about something similiar to <code>Cursor</code> in SQL?  Ask SQL Server to query a chunk and returns data and repeatly. </p>
  
  <pre><code>for loop{
      //query a chunk of records
  
      //return 
  
      //Next
  }
  </code></pre>
  
  <p>So I can caculate the progress and fill them into a single <code>DataTable</code>.</p>
  
  <p>Is it possible to do something above? If so, how?</p>
  
  <p>Because I seen an ASP.NET applicateion able to show the progress of loading a large data table, so I want to implement the same thing in WPF.</p>