ScriptTask Constructor

Initializes a new instance of the ScriptTask class.

命名空间: Microsoft.SqlServer.Dts.Tasks.ScriptTask
程序集: Microsoft.SqlServer.ScriptTask (in microsoft.sqlserver.scripttask.dll)

语法

声明
Public Sub New
public ScriptTask ()
public:
ScriptTask ()
public ScriptTask ()
public function ScriptTask ()

备注

Although you can call the task constructor, you typically create the task as a member of a package.

In the following example, the properties and methods of the ScriptTask are available using Properties of the TaskHost variable, th. For more information about casting the task, see the remarks in Add.

Package pkg = new Package();
Executable exec1 = pkg.Executables.Add("STOCK:ScriptTask");
TaskHost th = exec1 as TaskHost;
// You can cast the InnerObject of the TaskHost
// to the specific class.
// For the code samples, task properties are accessed by using
// the properties of the TaskHost.
// ScriptTask myTask = th.InnerObject as ScriptTask;
Dim pkg As Package =  New Package() 
Dim exec1 As Executable =  pkg.Executables.Add("STOCK:ScriptTask") 
Dim th As TaskHost =  exec1 as TaskHost 
' You can cast the InnerObject of the TaskHost
' to the specific class.
' For the code samples, task properties are accessed by using
' the properties of the TaskHost.
' Dim myTask As ScriptTask =  th.InnerObject as ScriptTask

示例

The following code sample creates a new ScriptTask by using the constructor.

ScriptTask myTask = new ScriptTask();
Dim myTask As ScriptTask =  New ScriptTask()

平台

开发平台

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

目标平台

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

请参阅

参考

ScriptTask Class
ScriptTask Members
Microsoft.SqlServer.Dts.Tasks.ScriptTask Namespace