--Original Message-
> From: Moderated discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of
> John St. Clair
> Sent: Friday, October 10, 2003 4:09 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net
>
> I
PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net
But what's wrong with creating a thread? If you use the threadpool it's
almost a one-liner! (Aside from the stub you'll prob have to write..)
I guess it's personal preference whether you prefer to use
lto:[EMAIL PROTECTED] On Behalf Of Jade Burton
Sent: 08 October 2003 11:15
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net
But what's wrong with creating a thread? If you use the threadpool it's
almost a one-liner! (Aside from the stub you'll
>> But what's wrong with creating a thread? If you use the
>> threadpool it's almost a one-liner!
>Although if you use the threadpool you almost certainly won't be
>creating a thread - you'll just be using a thread that was already in
>the thread pool most of the time.
>And that's typically a g
In keeping with Ian's comment, look at Bob Beauchemin's Essential ADO.NET,
Chapter 3. He has a section on cancellation where he says that *if* you do
wish the command to be cancelable, you need to both:
1. start the command on a separate thread, and
2. issue the cancel command on an additional sep
Jade Burton wrote:
>
> But what's wrong with creating a thread? If you use the
> threadpool it's almost a one-liner!
Although if you use the threadpool you almost certainly won't be
creating a thread - you'll just be using a thread that was already in
the thread pool most of the time.
And that'
- Original Message -
From: "Brian Gaer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 07, 2003 6:08 PM
Subject: [ADVANCED-DOTNET] Async Data Commands with ADO.Net
> Is anyone familiar with a method to have an ADO.Net command object
> perform a command.ExecuteNonQuery(
Use async delegates. Declare a delegate that matches
SqlCommand.ExecuteNonQuery, create an instance of the delegate, and call
BeginInvoke on it. Provide a completion delegate. In your completion
delegate, call the delegate's EndInvoke method. Badda-bing.
-- arlie
-Original Message-
F
You can call ANY method you wan using delegates:
public delegate int ExecuteNonQueryDelegate();
private void Foo()
{
SqlConnection conn = new SqlConnection("some connection string");
SqlCommand command = new SqlCommand("some stored procedure call");
ExecuteNonQueryDelegat
But what's wrong with creating a thread? If you use the threadpool it's
almost a one-liner! (Aside from the stub you'll prob have to write..)
I guess it's personal preference whether you prefer to use special async
APIs or whether you prefer fns that block until complete -- I personally
avoid as
10 matches
Mail list logo