data adapter fill method progress status

  • Thread starter Thread starter Bernie Yaeger
  • Start date Start date
B

Bernie Yaeger

Is there any way to get into the internals of the data adapter fill method
such that I could know its progress status? For example, using the fill
method to load a 40,000 row table takes just a few seconds, but using the
fill method to load a 1.2 million row table takes more than a minute. I
would like to do the latter with a progressbar, but I first have to know the
progress of the fill method to do this - eg, what record is it up to etc,
and, more practically, can I replicate the loop so that I have a progressive
row count.

Tx for any help.

Bernie Yaeger
 
Hi Bernie,

Certainly there is :)
Just hook up DataTable.RowChanged event - it is fired for evey row added
either by Adapter or some other way.
However, you won't know the total number of records prior to filling them
all - this is how the database behaves.
I suggest you to, instead of progress bar, just display the number of
records fetched (update the status every 100 records perhaps)
 
You could always do an "SELECT Count(*)" first to get the number of records,
that should be fast enough to not matter much overall. Then you can get
percentage as well.
 
Thanks Dan - I am doing precisely that.

Bernie
Daniel Carlsson said:
You could always do an "SELECT Count(*)" first to get the number of records,
that should be fast enough to not matter much overall. Then you can get
percentage as well.
 
Hi Daniel,

Daniel Carlsson said:
You could always do an "SELECT Count(*)" first to get the number of records,
that should be fast enough to not matter much overall. Then you can get
percentage as well.

Not if the select is complicated IOW it takes time.
 
Back
Top