fetching data asynchronously using ado.net dataset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am trying to get asynchronous fetching of data from sql server database. I
would like to show the progress of fetching records in GUI. Is there any
simple/complex steps for the same in C# using ado.net. Please help me. Have
good day. Thanks for your help in advance.
 
Hi
there is no simple way to do that , what you can do however is to use
DataReader Object and increment your progress bar one step with each record
reader .
DataReader however is a steam so you will not know the count of the rows
before hand so what you need to do it to create two queries for each query
you want to execute . One return the number of rows ( and you get that one
so you know how many steps would be in your progress bar ). the second one
is the actual query you want to execute , then get its result in a reader
and increment your progress bar by one step with each row read.
hope this helps
Mohamed M .Mahfouz
Developer Support Engineer
ITWorx on behalf of Microsoft EMEA GTSC
 
Back
Top