Click to Rate and Give Feedback
MSDN
MSDN Library
SQL Server
SQL Server 2008
Technical Reference
Application Class
Application Methods
 SaveToXml Method
Community Content
In this section
Statistics Annotations (0)
Collapse All/Expand All Collapse All
Other versions are also available for the following:
Application.SaveToXml Method

Saves the XML definition of a package to a file.

Namespace: Microsoft.SqlServer.Dts.Runtime
Assembly: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
VisualBasicDeclaration
Public Sub SaveToXml ( _
    fileName As String, _
    package As Package, _
    events As IDTSEvents _
)
CSharp
public void SaveToXml (
    string fileName,
    Package package,
    IDTSEvents events
)
ManagedCPlusPlus
public:
void SaveToXml (
    String^ fileName, 
    Package^ package, 
    IDTSEvents^ events
)
JSharp
public void SaveToXml (
    String fileName, 
    Package package, 
    IDTSEvents events
)
JScript
public function SaveToXml (
    fileName : String, 
    package : Package, 
    events : IDTSEvents
)

Parameters

fileName

The name of the file to save.

package

The package object to save.

events

An IDTSEvents object.

A package file normally has the extension, .dtsx.

If the file name specified in the fileName parameter does not exist, it will be created.


The following example saves the .dtsx package in XML format with the name myXMLPackage.dtsx.

CSharp
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);
        }
VisualBasic
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
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker