|
-
Aug 13th, 2010, 11:23 AM
#1
Thread Starter
Hyperactive Member
Progress bar with downloading
There is a button called "Data Refresh". Once user clicks it, a few jobs will start:
truncate 5 tables in local SQL server, insert data into 5 tables in local server from remote SQL server. It will take about 15 seconds.
How to add progress bar with data refresh?
-
Aug 13th, 2010, 05:05 PM
#2
Fanatic Member
Re: Progress bar with downloading
What code do you have already?
-
Aug 13th, 2010, 09:54 PM
#3
Re: Progress bar with downloading
It's important to understand that you cannot report progress to the user if you cannot measure progress yourself in code. If what you do is simply call a method and that method returns and the job is done then there's no way you can report progress on that. All you know is that the task is about to start (progress = 0% and the task has ended (progress = 100%), so that's all you can report to the user.
If your task is done in parts then you need to first calculate the proportion of the whole that each part represents. Let's say that you have 4 parts to your task. Does each task represent an equal proportion of the whole? If so then you can set your Minimum to 0, your Maximum to 4 and simply increment your Value after each part. If each part is not equal then it's up to you to assign a weight to each one. If the first three parts are equal but the last one takes four times longer then you might set the Maximum to 7 and increment by 1 after each of the first three tasks and then to 7 after the fourth. You might also set the Maximum to 100 and then assign a percentage of the whole to each part.
Basically, it's all up to you. You have to assign a weight to each part, you have to calculate the combined weight of the completed parts after each one completes. Again, as I said before, if you can't measure progress then you can't report it. If your task can't be broken into parts then you can't report progress. If your task can be broken into parts then do so and simply put a bit of code after each part to report the proportion of the whole that has completed.
-
Aug 16th, 2010, 10:39 AM
#4
Thread Starter
Hyperactive Member
Re: Progress bar with downloading
Thank you. I understood now.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|