Progress bar doesn't increment  
Author Message
yoweigh





PostPosted: Mon Jun 14 18:39:14 CDT 2004 Top

ADO >> Progress bar doesn't increment I created a windows form that has a progress bar on it. I am running a bunch of statements to update data on the database. I want the progress bar to increment (perform one step) after each update. The problem is that the progress bar doesn't move (it just sits there until the end) can anyone give me an example of how to accomplish this?

example:
progressBar1.Visible=true;
progressBar1.Show();
progressBar1.Maximum = 24;
progressBar1.Step = 1;
progressBar1.PerformStep();
Perform_update1;
progressBar1.PerformStep();
Perform_update2;
progressBar1.PerformStep();
Perform_update3;
etc.

thanks in advance

-Jeff-

DotNet297  
 
 
Mythran





PostPosted: Mon Jun 14 18:39:14 CDT 2004 Top

ADO >> Progress bar doesn't increment
"Jeff" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> I created a windows form that has a progress bar on it. I am running a bunch
of statements to update data on the database. I want the progress bar to
increment (perform one step) after each update. The problem is that the progress
bar doesn't move (it just sits there until the end) can anyone give me an example
of how to accomplish this?
>
> example:
> progressBar1.Visible=true;
> progressBar1.Show();
> progressBar1.Maximum = 24;
> progressBar1.Step = 1;
> progressBar1.PerformStep();
----------- Application.DoEvents();
> Perform_update1;
> progressBar1.PerformStep();
----------- Application.DoEvents();
> Perform_update2;
> progressBar1.PerformStep();
----------- Application.DoEvents();
> Perform_update3;
> etc.
>
> thanks in advance
>
> -Jeff-


Hope that helps.

Mythran


 
 
William





PostPosted: Mon Jun 14 21:37:01 CDT 2004 Top

ADO >> Progress bar doesn't increment You may want to trap RowUpdating/RowUpdated for each Adapter you are calling
update on. Right before you call update, set the Maximum value of the
progress bar to that datatables.Rows.Count, then increment it on either
Updating or Updated. After the update, reset it to 0 (the value) then reset
the Maximum to the next table's Rows.Count.

--
W.G. Ryan MVP Windows - Embedded

http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/
"Jeff" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> I created a windows form that has a progress bar on it. I am running a
bunch of statements to update data on the database. I want the progress bar
to increment (perform one step) after each update. The problem is that the
progress bar doesn't move (it just sits there until the end) can anyone give
me an example of how to accomplish this?
>
> example:
> progressBar1.Visible=true;
> progressBar1.Show();
> progressBar1.Maximum = 24;
> progressBar1.Step = 1;
> progressBar1.PerformStep();
> Perform_update1;
> progressBar1.PerformStep();
> Perform_update2;
> progressBar1.PerformStep();
> Perform_update3;
> etc.
>
> thanks in advance
>
> -Jeff-


 
 
Chris





PostPosted: Mon Jun 14 22:20:21 CDT 2004 Top

ADO >> Progress bar doesn't increment Actually your whole app will seam frozen as you are performing step after
step sequentially. To up the progress bar (and also for the window to
process any other messages like move, close, etc), call
Application.DoEvents(); call after each increment.

"Jeff" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> I created a windows form that has a progress bar on it. I am running a
bunch of statements to update data on the database. I want the progress bar
to increment (perform one step) after each update. The problem is that the
progress bar doesn't move (it just sits there until the end) can anyone give
me an example of how to accomplish this?
>
> example:
> progressBar1.Visible=true;
> progressBar1.Show();
> progressBar1.Maximum = 24;
> progressBar1.Step = 1;
> progressBar1.PerformStep();
> Perform_update1;
> progressBar1.PerformStep();
> Perform_update2;
> progressBar1.PerformStep();
> Perform_update3;
> etc.
>
> thanks in advance
>
> -Jeff-