Connecting Tech Pros Worldwide Forums | Help | Site Map

how to run progress bar while executing a long method or an update statement?

Newbie
 
Join Date: Oct 2008
Posts: 3
#1: 3 Weeks Ago
Hi,

I am unable to crack this as the end user requested to show some kind of progress bar while running a long time method or an update statement. Kindly suggest me on this ASAP.

Rgds,
TSKMJK

tlhintoq's Avatar
Moderator
 
Join Date: Mar 2008
Location: Arizona, USA
Posts: 1,789
#2: 3 Weeks Ago

re: how to run progress bar while executing a long method or an update statement?


Quote:
I am unable to crack this
Obviously you have already been working on this. What do you have so far?
Newbie
 
Join Date: Oct 2008
Posts: 3
#3: 3 Weeks Ago

re: how to run progress bar while executing a long method or an update statement?


Hi,

I have developed a vb.net application with MySQL as backend. Its a data massaging tool where it takes excel sheet as input and processes its data. During this long operations, end user asked to have a progress bar so that the progress can be known. But I am unable to do this as its a series of update sql statements which takes a long time and I am unable to run progress bar for this.

Kindly help

Rgds
TSKMJK
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,167
#4: 3 Weeks Ago

re: how to run progress bar while executing a long method or an update statement?


The long executing process should be run in a seperate thread.
Then you are free to update the progressbar as you like.
I recomend incrementing the bar by "task" and not by time. Much easier to estimate that way.
tlhintoq's Avatar
Moderator
 
Join Date: Mar 2008
Location: Arizona, USA
Posts: 1,789
#5: 3 Weeks Ago

re: how to run progress bar while executing a long method or an update statement?


If the processing is being handled by a program you wrote and are in control of, you could add an event that gets raised during each pass. That way your progress bar can receive the event and update.... 154 of 12,000 .....

But if the process is all contained in the MySQL database... I don't know what to tell you. Processing is happening inside a closed system.

Quote:

Originally Posted by tskmjk

this as its a series of update sql statements

Quote:

Originally Posted by Plater

I recomend incrementing the bar by "task" and not by time.

If you are in control of the series of SQL statements (each statement comes from your program, then Plater's suggestion makes the most sense.... Step 1 of 5....
insertAlias's Avatar
Forum Leader
 
Join Date: Apr 2008
Location: San Antonio, TX (USA)
Posts: 2,608
#6: 2 Weeks Ago

re: how to run progress bar while executing a long method or an update statement?


I suggest you use a BackgroundWorker to handle your long database commands. That way, the UI thread isn't blocked and you can update graphical elements.
Reply

Tags
bar, long, process, progress