Application.SaveToXml(String, Package, IDTSEvents) Methode

Definition

Speichert die XML-Definition eines Pakets in einer Datei.

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)

Parameter

fileName
String

Der Name der zu speichernden Datei.

package
Package

Das zu speichernde Paketobjekt.

events
IDTSEvents

Ein IDTSEvents-Objekt.

Beispiele

Im folgenden Beispiel wird das DTSX-Paket im XML-Format mit dem Namen myXMLPackage.dtsx gespeichert.

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  

Hinweise

Eine Paketdatei hat normalerweise die Erweiterung .dtsx.

Wenn der im fileName Parameter angegebene Dateiname nicht vorhanden ist, wird er erstellt.

Gilt für: