DtsEventHandler.GetPackagePath Método

Definición

Obtiene la ruta de acceso del paquete al que se aplica el controlador de eventos.

public:
 virtual System::String ^ GetPackagePath();
public string GetPackagePath ();
abstract member GetPackagePath : unit -> string
override this.GetPackagePath : unit -> string
Public Function GetPackagePath () As String

Devoluciones

Cadena que contiene la ruta de acceso del paquete.

Implementaciones

Ejemplos

En el ejemplo de código siguiente se crea un DtsEventHandler para el paquete y se muestra la ruta de acceso del paquete.

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  

Salida del ejemplo:

Ruta de acceso del paquete de DtsEventHandler: \Package.EventHandlers[OnError]

Se aplica a