Compartir a través de


Application.LoadFromDtsServer(String, String, IDTSEvents) Método

Definición

Carga un paquete del servidor especificado.

public:
 Microsoft::SqlServer::Dts::Runtime::Package ^ LoadFromDtsServer(System::String ^ sPackagePath, System::String ^ sServerName, Microsoft::SqlServer::Dts::Runtime::IDTSEvents ^ pEvents);
public Microsoft.SqlServer.Dts.Runtime.Package LoadFromDtsServer (string sPackagePath, string sServerName, Microsoft.SqlServer.Dts.Runtime.IDTSEvents pEvents);
member this.LoadFromDtsServer : string * string * Microsoft.SqlServer.Dts.Runtime.IDTSEvents -> Microsoft.SqlServer.Dts.Runtime.Package
Public Function LoadFromDtsServer (sPackagePath As String, sServerName As String, pEvents As IDTSEvents) As Package

Parámetros

sPackagePath
String

La ruta completa del paquete.

sServerName
String

El servidor en el que se almacena el paquete.

pEvents
IDTSEvents

Interfaz IDTSEvents.

Devoluciones

Un objeto Package.

Ejemplos

En el ejemplo de código siguiente se recuperan dos paquetes, denominados myp1Package y myp2Package, que se guardaron anteriormente en la carpeta Sistema de archivos del servicio Integration Services.

static void Main(string[] args)  
        {  
            Application app = new Application();  
            // Load the packages.  
            Package p1 = app.LoadFromDtsServer(@"File System\myp1Package", "yourserver", null);  
            Package p2 = app.LoadFromDtsServer(@"File System\myp2Package", "yourserver", null);  
            // Retrieve the ID (GUID) from the packages for display.  
            String p1_ID = p1.ID;  
            String p2_ID = p2.ID;  
            Console.WriteLine("ID for myp1Package = " + p1_ID);  
            Console.WriteLine("ID for myp2Package = " + p2_ID);  
        }  
Sub Main(ByVal args() As String)  
            Dim app As Application =  New Application()   
            ' Load the packages.  
            Dim p1 As Package =  app.LoadFromDtsServer("File System\myp1Package","yourserver",Nothing)   
            Dim p2 As Package =  app.LoadFromDtsServer("File System\myp2Package","yourserver",Nothing)   
            ' Retrieve the ID (GUID) from the packages for display.  
            Dim p1_ID As String =  p1.ID   
            Dim p2_ID As String =  p2.ID   
            Console.WriteLine("ID for myp1Package = " + p1_ID)  
            Console.WriteLine("ID for myp2Package = " + p2_ID)  
End Sub  

Salida del ejemplo:

ID for myp1Package = {598607C7-9C17-487D-A545-8D1C35FBF6E2}

ID for myp2Package = {F0D2E396-A6A5-42AE-9467-04CE946A810C}

Se aplica a