Solved

vs 2008 c# called stored procedure wait

Posted on 2010-11-22
3
467 Views
Last Modified: 2013-12-17
How would I construct a VS 2008 C# project that calls a stored procedure to present to the user a MessageBox that would blink as the stored procedure is running and then present one final message box when the stored procedure is complete. Right now the sp takes about 4 minutes to run. I want to give the user some visual cue that it is running and then a completion message. Right now, when I call the sp, the message box immediately appears because it is not waiting for anything from SQL to tell my project that the sp is complete. How do I get my project to wait for completion?
0
Comment
Question by:rwheeler23
3 Comments
 
LVL 9

Expert Comment

by:TonyReba
Comment Utility
Have you tried ajax?  this article shows a possible workaround to what you are doing..
http://blogs.infragistics.com/aspnet/articles/show-wait-indicator-during-webdatagrid-s-ajax-requests.aspx
0
 
LVL 32

Expert Comment

by:Erick37
Comment Utility
WinForms or WebForms?
0
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 500 total points
Comment Utility
Use Asynchronous delegates with call back on completion. Here is an example:-

YourDelegateObject.BeginInvoke("data.dat", new AsyncCallback(CallbackMethod), flusher);

void CallbackMethod(IAsyncResult result) {
   // get the delegate that was used to call that
   // method
   your code goes here
}

Please visit following links for more details:-
http://en.csharp-online.net/CSharp_Delegates_and_Events%E2%80%94Asynchronous_method_calls
http://msdn.microsoft.com/en-us/library/h80ttd5f.aspx
http://www.dotnetscraps.com/dotnetscraps/post/Explaining-Delegates-in-C-Part-4-(Asynchronous-Callback-Way-1).aspx

Hope it helps!!!
:-)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now