DynDeveloper.com

DynDeveloper.com

Sign Up Now! Log In
sgray128 8/6/2013 10:50:03 PM

.NET Development - Calling a subroutine asynchronously and waiting for the response

* This article, and all our great .NET Development documentation, Is available on the .NET Development menu

Calling a subroutine asynchronously and waiting for the response

I routinely need to call a stored procedure and wait 30 seconds for the response. The user is left wondering if there's anyone home. I can't open a 'please wait' dialog because the interface is frozen. Enter async.

Async calls have been around for a while, I see articles going back to 2009 and earlier, .NET 4.5 really brags about its multi-threading capabilities.

My needs are simpler. This article (written against .NET 3.5) is a short, simple block of code that show how to call a subroutine asynchronously and wait for the result.

In this example we have a second form called 'pleaseWait', it pops up and then disappears when the function returns

 

 

Version: Unknown or N/A
Section: .NET Development