April 2008
Intermediate to advanced
704 pages
17h 49m
English
Problem
You need to execute a query or command against a SQL Server database as a background task while your application continues with other processing.
Solution
Use the BeginExecuteNonQuery, BeginExecuteReader, or BeginExecuteXmlReader method of the System. Data.SqlClient.SqlCommand class to start the database operation as a background task. These methods all return a System.IAsyncResult object that you can use to determine the operation's status or use thread synchronization to wait for completion. Use the IAsyncResult object and the corresponding EndExecuteNonQuery, EndExecuteReader, or EndExecuteXmlReader method to obtain the result of the operation.
NOTE
Only the SqlCommand ...
Read now
Unlock full access