Solved

vs 2008 c# called stored procedure wait

Posted on 2010-11-22
3
486 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

624 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