Aracılığıyla paylaş


ConnectionManager.GetPackagePath Yöntemi

Alır veya ayarlar yol paketinin bağlantı için geçerlidir.

Ad Alanı:  Microsoft.SqlServer.Dts.Runtime
Derleme:  Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS içinde.dll)

Sözdizimi

'Bildirim
Public Function GetPackagePath As String
'Kullanım
Dim instance As ConnectionManager
Dim returnValue As String

returnValue = instance.GetPackagePath()
public string GetPackagePath()
public:
virtual String^ GetPackagePath() sealed
abstract GetPackagePath : unit -> string 
override GetPackagePath : unit -> string 
public final function GetPackagePath() : String

Dönüş Değeri

Tür: System.String
A dize paketi içeren yol.

Uygulamalar

IDTSPackagePath.GetPackagePath()

Örnekler

Aşağıdaki kod örneği, paketi verir yol pakette iki bağlantı için.

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

Örnek Çıktı:

PackagePath: \Package.Connections[{3427BFE1-F10C-4B7E-8E70-E8D9DC7DDBA3}]

PackagePath: \Package.Connections[{48B66F8D-7DFE-4D85-91C7-0999655484B2}]