Why is progress bar not updated when the main UI is running by using backgroundworker? c#.net?

It looks like most of your logic is on the UI thread itself instead of in the background thread. Basically, your UI is waiting (or sleeping) until the database is created before it can update.

You should wrap all of the work in to a single background worker that creates the database. You could kick of a sequence of methods for the steps of the create database method and check the result of each one to determine if you should cancel. As each step (or method) succeeds, you can report progress back on the callback event (BW_ProgressChanged).

In the progress changed event handler you want to update the txtProgress control there. If you start setting properties on UI controls in a background thread you will start running in to cross-threading issues.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions