Task Class

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

命名空间: Microsoft.SqlServer.Dts.Runtime
程序集: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

语法

声明
Public MustInherit Class Task
    Inherits DtsObject
    Implements IDTSManagedTask
public abstract class Task : DtsObject, IDTSManagedTask
public ref class Task abstract : public DtsObject, IDTSManagedTask
public abstract class Task extends DtsObject implements IDTSManagedTask
public abstract class Task extends DtsObject implements IDTSManagedTask

备注

已更新的示例代码:2006 年 7 月 17 日

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.

Inheritance Hierarchy

System.Object
   Microsoft.SqlServer.Dts.Runtime.DtsObject
    Microsoft.SqlServer.Dts.Runtime.Task
       Derived Classes

示例

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

线程安全

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.

平台

开发平台

有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。

目标平台

有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。

请参阅

参考

Task Members
Microsoft.SqlServer.Dts.Runtime Namespace