Solved

vs 2008 c# called stored procedure wait

Posted on 2010-11-22
3
472 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
ID: 34189720
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
ID: 34189983
WinForms or WebForms?
0
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 500 total points
ID: 34190330
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
No row return after calling the fillschema method 4 40
Visual Studio - "Windows Form Designer generated code" 2 40
Export import database 4 45
ASP.NET MVC 2 8
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

863 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

19 Experts available now in Live!

Get 1:1 Help Now