I have a silly problem but i am stuck. I am executing a stored procedure form my code procedure takes time so for this I am displaying a progress bar, which shows the progre
Please follow this method.
First calculate the time to execute the stored procedure.
db.Database.ExecuteSqlCommand("myquery");
enter code here
Allocate a separate thread/(part of process) for the execution of this query. by using the background worker control in c# (in do_work Event)
similarly assign an separate process thread using a background worker for displaying the progress-bar status.(in Progress-Changed Event) just increment value by 10%. give some small sleep (based on the time to consume your query divide it into ten parts). On completion make Progressbar.value=100 (in Run-Worker-CompletedEvent)
Please call both thread at mean time in
backgroundWorker1.RunWorkerAsync();
I think this solves your Problem.