DtsEventHandler.GetPackagePath Method ()

 

Gets the path of the package that the event handler applies to.

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

public string GetPackagePath()

Return Value

Type: System.String

A String that contains the package path.

The following code example creates a DtsEventHandler for the package, and shows the package path.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;

namespace Microsoft.SqlServer.SSIS.Samples
{
    class Program
    {
        static void Main(string[] args)
        {
            Package pkg = new Package();
            DtsEventHandler dtsEH = (DtsEventHandler)pkg.EventHandlers.Add("OnError");
            dtsEH.Executables.Add("STOCK:SendMailTask");

            // View the package path for the DtsEventHandler container.
            Console.WriteLine("Package Path of DtsEventHandler: {0}", dtsEH.GetPackagePath());
        }
    }
}

Sample Output:

Package Path of DtsEventHandler: \Package.EventHandlers[OnError]

Return to top
Show: