Share via


Task.ExecutionValue Proprietà

Definizione

Restituisce un oggetto definito dall'utente. Questo campo è di sola lettura.

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

Valore della proprietà

Oggetto definito dall'utente.

Esempio

Nell'esempio di codice seguente viene creata l'attività Invia posta elettronica, che eredita da Taske quindi visualizza le proprietà ereditate dall'attività.

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  

Esempio di output

ExecutionValue:

Versione: 0

WaitForMe: True

Commenti

La ExecutionValue proprietà della classe è una proprietà oggetto di sola lettura che offre all'attività la possibilità di esporre informazioni sui risultati dell'esecuzione Task , post-messaggi o restituire il DTSExecResult valore restituito. Ad esempio, se un'attività elimina le righe da una tabella come parte del Execute relativo metodo, potrebbe restituire il numero di righe eliminate come ExecutionValue. I client dell'attività potrebbero quindi usare questo valore per stabilire vincoli di precedenza tra le attività.

Le attività eseguono l'override dell'implementazione di base della ExecutionValue proprietà e di un valore impostato dall'attività durante Execute il metodo.

Si applica a