Task 类

Defines an abstract class that implements the methods and properties common to all tasks in Integration Services. 

继承层次结构

System. . :: . .Object
  Microsoft.SqlServer.Dts.Runtime. . :: . .DtsObject
    Microsoft.SqlServer.Dts.Runtime..::..Task
      更多信息...

命名空间:  Microsoft.SqlServer.Dts.Runtime
程序集:  Microsoft.SqlServer.ManagedDTS(在 Microsoft.SqlServer.ManagedDTS.dll 中)

语法

声明
Public MustInherit Class Task _
    Inherits DtsObject _
    Implements IDTSManagedTask
用法
Dim instance As Task
public abstract class Task : DtsObject, 
    IDTSManagedTask
public ref class Task abstract : public DtsObject, 
    IDTSManagedTask
[<AbstractClassAttribute>]
type Task =  
    class
        inherit DtsObject
        interface IDTSManagedTask
    end
public abstract class Task extends DtsObject implements IDTSManagedTask

Task 类型公开以下成员。

构造函数

  名称 说明
受保护方法 Task Initializes a new instance of the Task class.

页首

属性

  名称 说明
公共属性 ExecutionValue Returns a user-defined object. This field is read-only.
公共属性 Version *** Member deprecated; see Remarks. ***    Returns the version of the task. This property is read-only.

页首

方法

  名称 说明
公共方法 CanUpdate *** Member deprecated; see Remarks. ***    A Boolean that indicates whether the new package XML can update the old package XML.
公共方法 Equals Determines whether two object instances are equal. (从 DtsObject 继承。)
公共方法 Execute Runs the task.
受保护方法 Finalize (从 Object 继承。)
公共方法 GetConnectionID Gets a String containing the ID of the connection.
公共方法 GetConnectionName Gets a String containing the name of the connection.
公共方法 GetHashCode Returns the hash code for this instance. (从 DtsObject 继承。)
公共方法 GetType (从 Object 继承。)
公共方法 InitializeTask Initializes the properties associated with the task. This method is called by the runtime and is not used in code.
受保护方法 MemberwiseClone (从 Object 继承。)
公共方法 ToString (从 Object 继承。)
公共方法 Update *** Member deprecated; see Remarks. ***    This method updates the old package XML with the new package XML if CanUpdate is set to true.
公共方法 Validate Verifies that the component is properly configured.

页首

注释

A package consists of one or more tasks. These tasks define units of work that are performed as part of copying and transforming data, communicating with other processes, and performing database management functions.

Inherits from DtsObject and IDTSManagedTask.

示例

The following code example is a very simple task implementation for a custom task that inherits from Task.

using System;
using Microsoft.SqlServer.Dts.Runtime;

class MyTask : Task
{
    private int m_value = 123;

    public override DTExecResult Execute(Connections connections,
Variables variables, IDTSEvents events,
IDTSLogging log, int lastExecResult, DtsTransaction txn)
    {
        return m_value;
    }
}
Imports System
Imports Microsoft.SqlServer.Dts.Runtime
 
Class MyTask
    Inherits Task
    Private m_value As Integer =  123 
    Public Overrides DTExecResult Property connections,() As Execute(Connections
    End Property
Variables variables, IDTSEvents events,
IDTSLogging log,int Function txn)() As lastExecResult,DtsTransaction
        Return m_value
End Function
End Class

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。不保证所有实例成员都是线程安全的。

继承层次结构

System. . :: . .Object
  Microsoft.SqlServer.Dts.Runtime. . :: . .DtsObject
    Microsoft.SqlServer.Dts.Runtime..::..Task
      Microsoft.DataTransformationServices.Tasks.DTSProcessingTask. . :: . .ASTaskBase
      Microsoft.SqlServer.Dts.Tasks.ActiveXScriptTask. . :: . .ActiveXScriptTask
      Microsoft.SqlServer.Dts.Tasks.BulkInsertTask. . :: . .BulkInsertTask
      Microsoft.SqlServer.Dts.Tasks.DataProfilingTask. . :: . .DataProfilingTask
      Microsoft.SqlServer.Dts.Tasks.DMQueryTask. . :: . .DMQueryTask
      Microsoft.SqlServer.Dts.Tasks.Exec80PackageTask. . :: . .Exec80PackageTask
      Microsoft.SqlServer.Dts.Tasks.ExecuteProcess. . :: . .ExecuteProcess
      Microsoft.SqlServer.Dts.Tasks.ExecuteSQLTask. . :: . .ExecuteSQLTask
      Microsoft.SqlServer.Dts.Tasks.FileSystemTask. . :: . .FileSystemTask
      Microsoft.SqlServer.Dts.Tasks.FtpTask. . :: . .FtpTask
      Microsoft.SqlServer.Dts.Tasks.MessageQueueTask. . :: . .MessageQueueTask
      Microsoft.SqlServer.Dts.Tasks.ScriptTask. . :: . .ScriptTask
      Microsoft.SqlServer.Dts.Tasks.SendMailTask. . :: . .SendMailTask
      Microsoft.SqlServer.Dts.Tasks.TransferDatabaseTask. . :: . .TransferDatabaseTask
      Microsoft.SqlServer.Dts.Tasks.TransferErrorMessagesTask. . :: . .TransferErrorMessagesTask
      Microsoft.SqlServer.Dts.Tasks.TransferJobsTask. . :: . .TransferJobsTask
      Microsoft.SqlServer.Dts.Tasks.TransferLoginsTask. . :: . .TransferLoginsTask
      Microsoft.SqlServer.Dts.Tasks.TransferSqlServerObjectsTask. . :: . .TransferSqlServerObjectsTask
      Microsoft.SqlServer.Dts.Tasks.TransferStoredProceduresTask. . :: . .TransferStoredProceduresTask
      Microsoft.SqlServer.Dts.Tasks.WebServiceTask. . :: . .WebServiceTask
      Microsoft.SqlServer.Dts.Tasks.WmiDataReaderTask. . :: . .WmiDataReaderTask
      Microsoft.SqlServer.Dts.Tasks.WmiEventWatcherTask. . :: . .WmiEventWatcherTask
      Microsoft.SqlServer.Dts.Tasks.XMLTask. . :: . .XMLTask