Link to home
Start Free TrialLog in
Avatar of AnnaJames77
AnnaJames77

asked on

Stored Proc Progress bar

I have a stored proc that synchronises two db's. My question is when i call the stored proc from my application it shoukd show the status back to the user. something like a progress bar. when i googled i came through something called Background worker. can anyone one give an example how i can use it. or is there any other way.
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

The biggest problem with your progress bar will be setting the initial value of the "100%".
How do you know how long your sp will run ?
What you perhaps can do is split the sp into several smallers (fe 5 pieces) and update the progressbar each time when you call the next one.

How To Update Controls Using BackgroundWorker in VB.NET
http://vbnotebookfor.net/2007/09/24/how-to-update-controls-using-backgroundworker-in-vbnet/
>synchronises two db's.
How?

I think you would want to use a marquee style progressbar so that the stored procedure keeps running in the background but the UI is responsive so user is not frustrated.

http://www.youtube.com/watch?v=ZiVv_uPWOEs
Avatar of AnnaJames77
AnnaJames77

ASKER

thankyou CodeCruiser. but how can we know that the stored proc has completed its excution???
"but how can we know that the stored proc has completed its excution"

returns a return value or writes an "i am completed" row into the db and you poll it
If you dont use asynchronous ADO.NET, how do you know currently that stored procedure has completed? All you do is that you move the current code in backgroundworker and add a progressbar on the form.
Codecrusier can you pls let me know how to use the backgroundworker. When i googled too i got such an answer. but i donot know how to use it. In google got many answers but dint get one which uses a stored procedure with backgroundworker. CAn you help on this.
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial