Task.ExecutionValue Property
Returns a user-defined object. This field is read-only.
Spazio dei nomi: Microsoft.SqlServer.Dts.Runtime
Assembly : Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
Sintassi
'Dichiarazione
Public Overridable ReadOnly Property ExecutionValue As Object
public virtual Object ExecutionValue { get; }
public:
virtual property Object^ ExecutionValue {
Object^ get ();
}
/** @property */
public Object get_ExecutionValue ()
public function get ExecutionValue () : Object
Valore proprietà
A user-defined object.
Osservazioni
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.
Esempio
The following code example creates the Send Mail task, which inherits from Task, and then displays the properties the task has inherited.
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
Sample Output:
ExecutionValue:
Version: 0
WaitForMe: True
Thread Safety
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Piattaforme
Piattaforme di sviluppo
Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.
Piattaforme di destinazione
Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.
Vedere anche
Riferimento
Task Class
Task Members
Microsoft.SqlServer.Dts.Runtime Namespace