Asynchronous Execution in ADO.NET 2.0
page 1 of 9
Published: 17 Dec 2007
Abstract
In ADO.NET, when performing bulk database operations, the thread that is executing it will wait for the database operation to complete and proceed the execution of other lines. If the database operation is bulk and complicated, the amount of time the thread waiting will be more. To answer this, ADO.NET 2.0 is packed with a new feature to execute bulk operations asynchronously. This article takes you through the implementation of this new feature.
by Satheesh Babu
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 47219/ 144

Introduction

ADO.NET 2.0 is packed with many new features that make the developers' life easier. One such feature is executing bulk database operations asynchronously against a database. This article will help a developer to start programming asynchronous commands in ADO.NET 2.0. In previous versions of .NET it is not possible to execute a command asynchronously against a database. Well, this is mitigated with the arrival of new extensions in ADO.NET with 2.0 releases. To understand asynchronous programming we should first understand synchronous operation which is the common paradigm in ADO.NET.


View Entire Article

User Comments

Title: f   
Name: f
Date: 2012-09-29 7:03:06 AM
Comment:
f
Title: thank you   
Name: khoa
Date: 2011-06-12 7:21:13 PM
Comment:
very good code and article
Title: Code Monkey   
Name: King Kong
Date: 2009-10-29 12:20:15 PM
Comment:
This is a great article. Very concise and to the point.
Title: InvalidOperation exception   
Name: Ross
Date: 2009-01-29 9:36:34 AM
Comment:
Kevin - Is the DB connection still open at the point you call EndExecuteReader()?
Title: InvalidOperation exception   
Name: Kevin Burton
Date: 2008-12-18 11:42:00 PM
Comment:
I have some code that I was trying to improve by adding the new asynchronous SQL methods Begin... and End.... But when I add it to my code I get an exception:

InvalidOperationException.
{"The asynchronous operation has already completed."}

The first few frames of the stack trace look like:

at System.Data.SqlClient.SqlCommand.VerifyEndExecuteState(DbAsyncResult
dbAsyncResult, String endMethod)
at System.Data.SqlClient.SqlCommand.InternalEndExecuteReader(IAsyncResult
asyncResult, String endMethod)
at System.Data.SqlClient.SqlCommand.EndExecuteReader(IAsyncResult
asyncResult)

In searching the internet I see that at least one other person has seen this problem. I was wondering if there is a work around? If anyone has gotten the asynchronous methods to work without this exception I would very much appreciate their tips. I would also welcome a confirmation message of simply "this is a known bug".

Comments?

Thank you.

Kevin
Title: very useful   
Name: RuneAletheia
Date: 2008-12-16 3:24:03 PM
Comment:
this article was very helpful at explaining basic implementation of async -- also, the updated link to the reference is:

http://nayyeri.net/blog/Asynchronous-command-execution-in-NET-2-0/
Title: Very Good   
Name: Sunil Dhiman
Date: 2008-07-04 12:17:38 AM
Comment:
this article helped me very much.
thanks.
Title: Very Good   
Name: Samim Mondal
Date: 2008-04-02 3:16:42 AM
Comment:
Its very good article....
Title: RE:Thank you   
Name: satheesh babu
Date: 2008-03-24 12:55:18 PM
Comment:
Thanks for the comments guys!!
Satheesh
http://www.codedigest.com
Title: Thank you   
Name: Beri
Date: 2008-03-24 12:51:21 PM
Comment:
I've been struggling to make sense of Asynchronous Transcations. This article has helped me a lot. Thank you very much Sateesh.
Title: Mrs   
Name: JayaNayagam
Date: 2008-01-07 1:14:14 AM
Comment:
The author explains quite clearly,quite useful.
Title: Nice info   
Name: Abhishek Kumar Singh
Date: 2007-12-20 4:41:16 AM
Comment:
nice one

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-10-09 3:30:03 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search