I have a background worker running a long database task. i want to show the progress bar while the task is running. Somehow the background worker won\'t report the progres
You need to call worker.ReportProgress(percentComplete) in your DoWork method. percentComplete should be computed based on the total work. For example:
for(int i =0; i != 100; i++) {
// do something
worker.ReportProgress(i);
}
Sometimes it is difficult to partition a job in several chunks to be possible to report the progress. Unfortunately the BackgroundWorker does not solve this, you have to do it yourself.