Solved

vs 2008 c# called stored procedure wait

Posted on 2010-11-22
3
475 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# Offline Apllication 5 70
SSL https .net web site force redirect 3 48
Interview questions for support of a legacy ASP.NET site 4 56
No Data for DropDown List 2 22
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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.

785 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