TaskHost.GetPackagePath Method
Returns the path to the task location.
네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
구문
‘선언
Public Function GetPackagePath As String
public string GetPackagePath ()
public:
virtual String^ GetPackagePath () sealed
public final String GetPackagePath ()
public final function GetPackagePath () : String
반환 값
A String that contains the location of the package.
예
The following code example adds a Sequence container to a package, then adds a FileSystemTask. Using GetPackagePath, the path of the package for the FileSystemTask is returned.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Tasks.FileSystemTask;
namespace Microsoft.SqlServer.SSIS.Samples
{
class mySample
{
static void Main(string[] args)
{
Package package = new Package();
Sequence seq = (Sequence)package.Executables.Add("STOCK:SEQUENCE");
// Add a File System task.
Executable eFileTask1 = seq.Executables.Add("STOCK:FileSystemTask");
TaskHost thFileTask1 = eFileTask1 as TaskHost;
// Use GetPackagePath of the TaskHost.
String pkgPath = thFileTask1.GetPackagePath();
Console.WriteLine("Package path: {0}", pkgPath);
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks.FileSystemTask
Namespace Microsoft.SqlServer.SSIS.Samples
Class mySample
Shared Sub Main(ByVal args() As String)
Dim package As Package = New Package()
Dim seq As Sequence = CType(package.Executables.Add("STOCK:SEQUENCE"), Sequence)
' Add a File System task.
Dim eFileTask1 As Executable = seq.Executables.Add("STOCK:FileSystemTask")
Dim thFileTask1 As TaskHost = eFileTask1 as TaskHost
' Use GetPackagePath of the TaskHost.
Dim pkgPath As String = thFileTask1.GetPackagePath()
Console.WriteLine("Package path: {0}", pkgPath)
End Sub
End Class
End Namespace
Sample Output:
Package path: \Package\{4CE5CB4E-E124-4523-BE8B-D934BAF907D5}\{BFD1E4F1-53CF-4130-989E-E11FD853DA18}
스레드 보안
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 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
참고 항목
참조
TaskHost Class
TaskHost Members
Microsoft.SqlServer.Dts.Runtime Namespace