IDTSPackagePath.GetPackagePath Method ()

 

Returns a String that contains the relative path to the package location.

Namespace:   Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

string GetPackagePath()

Return Value

Type: System.String

A String that contains the relative path to the package location.

This interface is inherited by containers. In the Integration Services architecture, containers provide structure and services to tasks. A package is a type of container. The other container types that SSIS includes are the For Loop, Foreach Loop, Sequence, task host containers and event handlers. For more information, see Integration Services (SSIS) Packages.

The ConnectionManager class inherits from this interface. The following code example shows the ConnectionManager using the GetPackagePath method.

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());
            }
        }
    }
}

Sample Output:

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

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

Return to top
Show: