Udostępnij za pośrednictwem


Metoda Application.SaveToXml

Zapisuje plik definicji pakiet XML.

Przestrzeń nazw:  Microsoft.SqlServer.Dts.Runtime
Zestaw:  Microsoft.SqlServer.ManagedDTS (w Microsoft.SqlServer.ManagedDTS.dll)

Składnia

'Deklaracja
Public Sub SaveToXml ( _
    fileName As String, _
    package As Package, _
    events As IDTSEvents _
)
'Użycie
Dim instance As Application
Dim fileName As String
Dim package As Package
Dim events As IDTSEvents

instance.SaveToXml(fileName, package, _
    events)
public void SaveToXml(
    string fileName,
    Package package,
    IDTSEvents events
)
public:
void SaveToXml(
    String^ fileName, 
    Package^ package, 
    IDTSEvents^ events
)
member SaveToXml : 
        fileName:string * 
        package:Package * 
        events:IDTSEvents -> unit 
public function SaveToXml(
    fileName : String, 
    package : Package, 
    events : IDTSEvents
)

Parametry

Uwagi

Plik pakiet zwykle ma rozszerzenie .dtsx.

Jeśli nazwa pliku określona w fileName parametr nie istnieje, zostanie on utworzony.

Przykłady

Poniższy przykład zapisuje pakiet .dtsx w formacie XML z nazwą 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