PC Review


Reply
Thread Tools Rate Thread

Asynch stored proc calls

 
 
John
Guest
Posts: n/a
 
      11th Aug 2005
Hi,

I appologize for such a simple question that I should easily be able to find
on my own. But I am having a difficult time finding it today .. just not my
day I guess.

How do you make an asynchronous stored procedure call from IDbCommand?

Here is what I tried thinking it might just run asynch by default.
---------------------
public void Run()
{
IDbCommand cmd = myConnection.CreateCommand();
cmd.CommandText = "MySlowProc";
cmd.CommandType = CommandType.StoredProcedure;
cmd.ExecuteNonQuery();
}
---------------------

Do I need to create a worker thread for this?

--
Thanks,
John


 
Reply With Quote
 
 
 
 
W.G. Ryan MVP
Guest
Posts: n/a
 
      11th Aug 2005
You can create a delegate that matches the method that calls the routine
with the stored proc in it. Then you can just use .BeginInvoke. Or you can
use a Worker thread as well. Here's a quick example - you can just
substitue the routine you're using with the proc for it.

http://www.knowdotnet.com/articles/d...printable.html
"John" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I appologize for such a simple question that I should easily be able to
> find on my own. But I am having a difficult time finding it today .. just
> not my day I guess.
>
> How do you make an asynchronous stored procedure call from IDbCommand?
>
> Here is what I tried thinking it might just run asynch by default.
> ---------------------
> public void Run()
> {
> IDbCommand cmd = myConnection.CreateCommand();
> cmd.CommandText = "MySlowProc";
> cmd.CommandType = CommandType.StoredProcedure;
> cmd.ExecuteNonQuery();
> }
> ---------------------
>
> Do I need to create a worker thread for this?
>
> --
> Thanks,
> John
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I set my database to trustworthy and deployed this clr stored proc as unsafe ok but when i run this it returns 1 each time. as if ival keeps getting set back to 0 each time i call this clr stored proc. How to fix so that ival keeps its current value DR Microsoft Dot NET Framework 0 29th Oct 2007 11:18 PM
I set my database to trustworthy and deployed this clr stored proc as unsafe ok but when i run this it returns 1 each time. as if ival keeps getting set back to 0 each time i call this clr stored proc. How to fix so that ival keeps its current value DR Microsoft Dot NET 0 29th Oct 2007 11:17 PM
Get return values from a stored proc inside a stored proc =?Utf-8?B?Q2FsdmluIEtE?= Microsoft ADO .NET 2 20th Nov 2005 11:40 PM
getting error in ADO in stored proc with two calls rsstonejr@yahoo.com Microsoft Access 0 3rd Oct 2005 09:38 PM
Performance Counters for stored proc calls within DTS ShikariShambu Microsoft Dot NET Framework 3 8th Mar 2004 09:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:38 PM.