October 2010
Intermediate to advanced
1920 pages
73h 55m
English
There are asynchronous versions of several ADO.NET methods. These methods come in pairs: a Begin and End method. For example, the SqlCommand object supports the following asynchronous methods:
• BeginExecuteNonQuery()
• EndExecuteNonQuery()
• BeginExecuteReader()
• EndExecuteReader()
• BeginExecuteXmlReader()
• EndExecuteXmlReader()
The idea is that when you execute the Begin method, the asynchronous task is started on a separate thread. When the method finishes executing, you can use the End method to get the results.
To use these asynchronous methods, you must use a special attribute in your connection string: the Asynchronous Processing=true attribute.
The data access component in Listing 19.34 contains a ...
Read now
Unlock full access