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)

Syntax

'Declaration
Public Function GetPackagePath As String
public string GetPackagePath ()
public:
virtual String^ GetPackagePath () sealed
public final String GetPackagePath ()
public final function GetPackagePath () : String

Rückgabewert

A String that contains the package path.

Beispiel

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());
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
 
Namespace Microsoft.SqlServer.SSIS.Samples
    Class Program
        Shared  Sub Main(ByVal args() As String)
            Dim pkg As Package =  New Package() 
            Dim dtsEH As DtsEventHandler = CType(pkg.EventHandlers.Add("OnError"), DtsEventHandler)
            dtsEH.Executables.Add("STOCK:SendMailTask")

            ' View the package path for the DtsEventHandler container.
            Console.WriteLine("Package Path of DtsEventHandler: {0}", dtsEH.GetPackagePath())
        End Sub
    End Class
End Namespace

Sample Output:

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

Threadsicherheit

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Plattformen

Entwicklungsplattformen

Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.

Zielplattforme

Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.

Siehe auch

Verweis

DtsEventHandler Class
DtsEventHandler Members
Microsoft.SqlServer.Dts.Runtime Namespace