다음을 통해 공유


Application.SaveToXml Method

Saves the XML definition of a package to a file.

네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

구문

‘선언
Public Sub SaveToXml ( _
    fileName As String, _
    package As Package, _
    events As IDTSEvents _
)
public void SaveToXml (
    string fileName,
    Package package,
    IDTSEvents events
)
public:
void SaveToXml (
    String^ fileName, 
    Package^ package, 
    IDTSEvents^ events
)
public void SaveToXml (
    String fileName, 
    Package package, 
    IDTSEvents events
)
public function SaveToXml (
    fileName : String, 
    package : Package, 
    events : IDTSEvents
)

매개 변수

  • fileName
    The name of the file to save.
  • package
    The package object to save.

주의

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.

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\90\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\90\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.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

Application Class
Application Members
Microsoft.SqlServer.Dts.Runtime Namespace