Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net

2003-10-10 Thread Mike Woodring
--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

Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net

2003-10-10 Thread John St. Clair
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

Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net

2003-10-09 Thread Erymuzuan Mustapa
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

Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net

2003-10-09 Thread Daniel O'Connell
>> 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

Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net

2003-10-08 Thread John St. Clair
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

Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net

2003-10-08 Thread Griffiths, Ian
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'

Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net

2003-10-08 Thread Daniel O'Connell
- 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(

Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net

2003-10-08 Thread Arlie Davis
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

Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net

2003-10-08 Thread Emilio D'Angelo Yofre
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

Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net

2003-10-07 Thread Jade Burton
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