Condividi tramite


Application.SaveToXml(String, Package, IDTSEvents) Metodo

Definizione

Salva la definizione XML di un pacchetto in un file.

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)

Parametri

fileName
String

Nome del file da salvare.

package
Package

Oggetto pacchetto da salvare.

events
IDTSEvents

Oggetto IDTSEvents.

Esempio

Nell'esempio seguente il pacchetto dtsx viene salvato in formato XML con il nome 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  

Commenti

Un file di pacchetto ha in genere l'estensione dtsx.

Se il nome file specificato nel fileName parametro non esiste, verrà creato.

Si applica a