IDTSPackagePath.GetPackagePath 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回一个字符串,其中包含包位置的相对路径。
public:
System::String ^ GetPackagePath();
public string GetPackagePath ();
abstract member GetPackagePath : unit -> string
Public Function GetPackagePath () As String
返回
包含包位置的相对路径的字符串。
示例
该 ConnectionManager 类继承自此接口。 下面的代码示例演示 ConnectionManager 了如何使用该方法 GetPackagePath 。
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace Connections_Collection
{
class Program
{
static void Main(string[] args)
{
// The package is one of the SSIS Samples.
string mySample = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx";
// Create an application and load the sample.
Application app = new Application();
Package pkg = app.LoadPackage(mySample, null);
Connections myConns = pkg.Connections;
// Get the package path.
foreach (ConnectionManager connMgr in myConns)
{
Console.WriteLine("PackagePath: {0}", connMgr.GetPackagePath());
}
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Namespace Connections_Collection
Class Program
Shared Sub Main(ByVal args() As String)
' The package is one of the SSIS Samples.
Dim mySample As String = "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx"
' Create an application and load the sample.
Dim app As Application = New Application()
Dim pkg As Package = app.LoadPackage(mySample,Nothing)
Dim myConns As Connections = pkg.Connections
' Get the package path.
Dim connMgr As ConnectionManager
For Each connMgr In myConns
Console.WriteLine("PackagePath: {0}", connMgr.GetPackagePath())
Next
End Sub
End Class
End Namespace
示例输出:
PackagePath: \Package.Connections[{3427BFE1-F10C-4B7E-8E70-E8D9DC7DDBA3}]
PackagePath: \Package.Connections[{48B66F8D-7DFE-4D85-91C7-099965484B2}]
注解
此接口由容器继承。 在 Integration Services 体系结构中,容器为任务提供结构和服务。 包是容器类型。 SSIS 包括的其他容器类型是 For 循环、Foreach 循环、序列、任务主机容器和事件处理程序。 有关详细信息,请参阅 Integration Services (SSIS) 包。