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.
BeginExecuteNonQuery 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.
To start running a query, you have to call BeginExecuteNonQuery method, which in turn invokes appropriate actions in another thread. Return value of this method must be assigned to System.IAsyncResult object. After executing this method program flow continues.
When you are ready to accept query results, call EndExecuteNonQuery. If at the moment you call this function the query execution has not yet been finished, application stops and waits till the function returns number of rows affected by the query.
Refer to "Asynchronous Query Execution" article for detailed information.
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