Assembly: Dal;
Namespace: Prognoz.Platform.Interop.Dal;
The IDalCommandTask interface contains properties of the task that is used to work with database using SQL queries in the asynchronous mode.
IDalCommandTask
This task is used for asynchronous execution of the SQL queries to database. Asynchronous execution enables the user to continue working in the application without waiting for result of SQL query execution. To work with the task:
Create a command that is described by the IDalCommand interface and set up its parameters.
Cast the obtained command to the IDalCommand2 interface.
Execute the CreateTask method to create a task.
Cast the obtained task to the ITask interface. Task execution can be controlled using properties and methods of this interface.
After executing the task output values are available in the Result property.
Asynchronous execution of SQL queries to database is available if the following requirements are met:
The database server is based on the Oracle DBMS 9.0 or later or the MSSQL DBMS 2008 or later.
Only one command is specified in the SQL query. Use stored procedure to execute a block of commands or create a 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 at 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 task destination. | ||
The Result property returns task execution result. |
See also: