Hi, I am running a store procedure, which takes a long time so i need some way of telling the user somthing is happening. Any one have a sample code of how to do this?
How to run a store procedure and show users somthing is happening
Collapse
X
-
You could use a progress bar. Maybe set it to continuous. You'll want to execute the SP on a separate thread. -
I have seen a sneaky trick (most often employeed in webpages, but it can work anywhere) Is to simply have some sort of animation (a gif perhaps?) that becomes visible when the task is started, and invisible when the task is completed.
There is no notion of "task is x% completed", but it does alert the user that something is happening.
I myself popup a static "LOADING... " dialog while I am doing some processing.Comment
-
Originally posted by TafthemanHow is this done i was looking at using javascript to make a div visible or not, how would this be done
Can you use the .NET Framework 3.5? There is a perfect premade solution, if you can. UpdatePanel and UpdateProgress.
If you can't, I'd suggest writing a page that does nothing but execute your SP. Then, from another page, use an XmlHttpRequest javascript object to invoke that page, and show a DIV with an animated GIF in it.Comment
-
If the program flow is roughly:- User clicks a button(or something else)
- A postback is fired
- Stored procedure is executed, taking up some time
- Results are sent back, which is a page reload
You can use the sneaky trick other websites use
- (Page is loaded with an image hidden)
- User clicks a button(or something else)
- The image is unhidden (image can be a large picture of "please wait" or anything you want)
- A postback is fired
- Stored procedure is executed, taking up some time
- Results are sent back, which is a page reload (which means image is hidden once more)
What I did with my page, to help ensure the user would not keep clicking the button, was to use javascript to change the CSS style of the button to be hidden and to make visible a <div> that said "Please wait..." where the button used to beComment
Comment