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:

Version: 0

WaitForMe: True

注釈

ExecutionValue クラスの Task プロパティは、タスクが実行結果に関する情報を公開したり、メッセージを送信したり、DTSExecResult 戻り値を返したりできるようにする読み取り専用のオブジェクト プロパティです。 たとえば、タスクがその Execute メソッドの一部としてテーブルから行を削除すると、削除された行数は、ExecutionValue として返されます。 タスクのクライアントは、この値を使用してタスク間の優先順位制約を確立できます。

タスクは、ExecutionValue プロパティの基本実装や、その Execute メソッドの実行中にタスクで設定された値よりもオーバーライドされます。

適用対象