DtsProperty.GetPackagePath(Object) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 패키지 위치까지의 상대 경로를 포함하는 문자열을 반환합니다.
public:
System::String ^ GetPackagePath(System::Object ^ o);
public string GetPackagePath(object o);
member this.GetPackagePath : obj -> string
Public Function GetPackagePath (o As Object) As String
매개 변수
- o
- Object
패키지를 포함하는 객체입니다.
반품
지정된 패키지 위치까지의 상대 경로를 포함하는 문자열입니다.
예제
다음 코드 예시는 패키지 경로를 가져오는 다양한 방법을 보여줍니다. 메서드에서 GetPackagePath 하나의 값이 반환되며, 컬렉션의 DtsProperties 첫 번째 속성에 대한 속성을 GetPackagePath 사용합니다. 다른 패키지 경로는 . 에 직접 Package구현된 것에서 반환 GetPackagePath 됩니다. 출력은 메서드에서 반환된 값들을 보여줍니다.
// other Using statements here...
using Microsoft.SqlServer.Dts.Runtime;
namespace DtsPropertiesTesting
{
class Program
{
static void Main(string[] args)
{
// The variable pkg points to the location
// of the ExecuteProcess package sample
// that is installed with the samples.
string packageFile = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";
Application application = new Application();
Package package = application.LoadPackage(packageFile, null);
// Retrieve the information from the Properties collection.
// Each item in the collection represents a property on the
// Package object.
DtsProperties properties = package.Properties;
String propertyName;
DTSPropertyKind propertyKind;
String packagePath;
TypeCode propertyType;
foreach (DtsProperty property in properties)
{
propertyType = property.Type;
propertyName = property.Name;
propertyKind = property.PropertyKind;
packagePath = property.GetPackagePath(package);
Console.WriteLine("Property Type: {0}, Property Name: {1}, Property Kind: {2}, Package Path: {3} ", propertyType, propertyName, propertyKind, packagePath);
}
}
}
}
' other Using statements here...
Imports Microsoft.SqlServer.Dts.Runtime
Namespace DtsPropertiesTesting
Class Program
Shared Sub Main(ByVal args() As String)
' The variable pkg points to the location
' of the ExecuteProcess package sample
' that is installed with the samples.
Dim packageFile As String = "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx"
Dim application As Application = New Application()
Dim package As Package = application.LoadPackage(packageFile,Nothing)
' Retrieve the information from the Properties collection.
' Each item in the collection represents a property on the
' Package object.
Dim properties As DtsProperties = package.Properties
Dim propertyName As String
Dim propertyKind As DTSPropertyKind
Dim packagePath As String
Dim propertyType As TypeCode
Dim property As DtsProperty
For Each property In properties
propertyType = property.Type
propertyName = property.Name
propertyKind = property.PropertyKind
packagePath = property.GetPackagePath(package)
Console.WriteLine("Property Type: {0}, Property Name: {1}, Property Kind: {2}, Package Path: {3} ", propertyType, propertyName, propertyKind, packagePath)
Next
End Sub
End Class
End Namespace
샘플 출력:
Package path = \Package
Package properties path = \Package.CertificateContext
Package properties path = \Package.CertificateObject
Package properties path = \Package.CheckpointFileName