Task.ExecutionValue 属性

定义

返回用户定义对象。 此字段为只读。

public:
 virtual property System::Object ^ ExecutionValue { System::Object ^ get(); };
public virtual object ExecutionValue { get; }
member this.ExecutionValue : obj
Public Overridable ReadOnly Property ExecutionValue As Object

属性值

一个用户定义对象。

示例

下面的代码示例创建从中 Task继承的“发送邮件”任务,然后显示任务继承的属性。

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  
using Microsoft.SqlServer.Dts.Tasks.SendMailTask;  

namespace Microsoft.SqlServer.SSIS.Samples  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            Application app = new Application();  
            Package pkg = new Package();  
            // Add a Send Mail task to the package.  
            Executable exec = pkg.Executables.Add("STOCK:SendMailTask");  

            // Cast the task to its own class.  
            TaskHost th = exec as TaskHost;  
            SendMailTask smTask = 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);  
        }  
    }  
}  
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  

示例输出:

ExecutionValue:

版本:0

WaitForMe: True

注解

ExecutionValue类的属性Task是一个只读对象属性,它使任务能够公开有关其执行结果、发布消息或返回DTSExecResult返回值的信息。 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. 然后,任务的客户端可以使用此值在任务之间建立优先约束。

任务将替代属性的基本 ExecutionValue 实现及其方法过程中 Execute 由任务设置的值。

适用于