Parameters
- callback
- The delegate to call when the asynchronous invoke is complete. If callback is a null reference (Nothing in Visual Basic), the delegate is not called.
- stateObject
- State information that is passed on to the delegate.
BeginExecuteReader method enables you to execute a query on a server without having current thread blocked. In other words, your program can continue execution while the query runs on Salesforce.com or Database.com so you do not have to wait for it.
Refer to "Asynchronous Query Execution" article for detailed information.
To start running a query, you have to call BeginExecuteReader method, which in turn invokes appropriate actions in another thread. Return value of this method must be assigned to an System.IAsyncResult object. After executing this method, the program flow continues.
When you are ready to accept query results, call EndExecuteReader. If at the moment you call this function the query execution has not yet been finished, application stops and waits till the function returns. Then you can treat a DbDataReaderBase in a common way.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2