ExecutionValue Property
Collapse the table of content
Expand the table of content

Task.ExecutionValue Property


Returns a user-defined object. This field is read-only.

Namespace:   Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

Public Overridable ReadOnly Property ExecutionValue As Object

Property Value

Type: System.Object

A user-defined object.

The ExecutionValue property of the Task class is a read-only object property that gives the task the ability to expose information regarding the results of its execution, post messages, or return the DTSExecResult return value. For example, if a task deletes rows from a table as part of its Execute method, it might return the number of rows deleted as the ExecutionValue. Clients of the task could then use this value to establish precedence constraints between tasks.

Tasks override the base implementation of the ExecutionValue property and a value that is set by the task during its Execute method.

The following code example creates the Send Mail task, which inherits from Task, and then displays the properties the task has inherited.

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks.SendMailTask

Namespace Microsoft.SqlServer.SSIS.Samples
    Class Program
        Shared  Sub Main(ByVal args() As String)
            Dim app As Application =  New Application() 
            Dim pkg As Package =  New Package() 
            ' Add a Send Mail task to the package.
            Dim exec As Executable =  pkg.Executables.Add("STOCK:SendMailTask") 

            ' Cast the task to its own class.
            Dim th As TaskHost =  exec as TaskHost 
            Dim smTask As SendMailTask =  th.InnerObject as SendMailTask 

            ' Display the properties inherited from Task.
            Console.WriteLine("ExecutionValue: {0}", smTask.ExecutionValue)
            Console.WriteLine("Version: {0}", smTask.Version)
            Console.WriteLine("WaitForMe: {0}", smTask.WaitForMe)
        End Sub
    End Class
End Namespace

Sample Output:


Version: 0

WaitForMe: True

Return to top
© 2015 Microsoft