'Declaration Public Overloads Function BeginExecuteReader( _ ByVal behavior As CommandBehavior _ ) As IAsyncResult |
public IAsyncResult BeginExecuteReader( CommandBehavior behavior ) |
Parameters
- behavior
- One of the System.Data.CommandBehavior values.
'Declaration Public Overloads Function BeginExecuteReader( _ ByVal behavior As CommandBehavior _ ) As IAsyncResult |
public IAsyncResult BeginExecuteReader( CommandBehavior behavior ) |
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 PostgreSQL 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.