Compartir a través de


Application.SaveToXml(String, Package, IDTSEvents) Método

Definición

Guarda la definición XML de un paquete en un archivo.

public:
 void SaveToXml(System::String ^ fileName, Microsoft::SqlServer::Dts::Runtime::Package ^ package, Microsoft::SqlServer::Dts::Runtime::IDTSEvents ^ events);
public void SaveToXml (string fileName, Microsoft.SqlServer.Dts.Runtime.Package package, Microsoft.SqlServer.Dts.Runtime.IDTSEvents events);
member this.SaveToXml : string * Microsoft.SqlServer.Dts.Runtime.Package * Microsoft.SqlServer.Dts.Runtime.IDTSEvents -> unit
Public Sub SaveToXml (fileName As String, package As Package, events As IDTSEvents)

Parámetros

fileName
String

El nombre del archivo que se va a guardar.

package
Package

El objeto de paquete que se va a guardar.

events
IDTSEvents

Objeto IDTSEvents.

Ejemplos

En el ejemplo siguiente se guarda el paquete .dtsx en formato XML con el nombre myXMLPackage.dtsx.

static void Main(string[] args)  
        {  
            // The variable pkg points to the location  
            // of the ExecuteProcess package sample   
            // that is installed with the SSIS samples.  
            string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";  

            Application app = new Application();  
            Package p = app.LoadPackage(pkg, null);  
            app.SaveToXml("myXMLPackage.dtsx", p, null);  
        }  
Shared  Sub Main(ByVal args() As String)  
            ' The variable pkg points to the location  
            ' of the ExecuteProcess package sample   
            ' that is installed with the SSIS samples.  
            Dim pkg As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx"   

            Dim app As Application =  New Application()   
            Dim p As Package =  app.LoadPackage(pkg,Nothing)   
            app.SaveToXml("myXMLPackage.dtsx", p, Nothing)  
End Sub  

Comentarios

Normalmente, un archivo de paquete tiene la extensión .dtsx.

Si el nombre de archivo especificado en el fileName parámetro no existe, se creará.

Se aplica a