Assembly: Dal;
Namespace: Prognoz.Platform.Interop.Dal;
The IDalCommandTask interface contains properties of the task used to work with the database using the SQL queries in the asynchronous mode.
IDalCommandTask
This task is used for asynchronous execution of the SQL queries to the database. Asynchronous execution enables user to continue working in the application without waiting for result of the SQL query execution. To work with the task it is necessary:
To create a command that is described by the IDalCommand interface and to configure its parameters.
To cast the obtained command to the IDalCommand2 interface.
To execute the CreateTask method to create the task.
To cast the received task to the ITask interface . Process of the task execution can be controlled using properties and methods of this interface.
After executing the task resulting values are available in the Result property.
Asynchronous execution of the SQL queries to the database is acceptable, if the following requirements are complied:
The database server is based the Oracle 9.x DBMS or later or the MSSQL 2008 DBMS or later.
Only one command is specified in the SQL query. Use stored procedure to execute a block of commands or create task queue.
The "SET NOCOUNT ON" string must be stated at the beginning of the procedure text after the AS BEGIN string for asynchronous execution of the stored procedures which were created on the MSSQL server.
NOTE. Only one task that executes the SQL queries can be executed asynchronously within one database connection. It is necessary to create separate connections to execute several tasks or organize task queue.
| Property name | Brief description | |
| The ExecuteType property returns destination of the task. | ||
| The Result property returns a result of the task execution. |
See also: