Partager via


Méthode SaveToXML

This method is not callable by your application code. To save a package as .xml, use the Application..::..SaveToXml method.

Espace de noms :  Microsoft.SqlServer.Dts.Tasks.ExecuteSQLTask
Assembly :  Microsoft.SqlServer.SQLTask (en Microsoft.SqlServer.SQLTask.dll)

Syntaxe

'Déclaration
Public Sub SaveToXML ( _
    doc As XmlDocument, _
    events As IDTSInfoEvents _
)
'Utilisation
Dim instance As ExecuteSQLTask
Dim doc As XmlDocument
Dim events As IDTSInfoEvents

instance.SaveToXML(doc, events)
public void SaveToXML(
    XmlDocument doc,
    IDTSInfoEvents events
)
public:
virtual void SaveToXML(
    XmlDocument^ doc, 
    IDTSInfoEvents^ events
) sealed
abstract SaveToXML : 
        doc:XmlDocument * 
        events:IDTSInfoEvents -> unit 
override SaveToXML : 
        doc:XmlDocument * 
        events:IDTSInfoEvents -> unit 
public final function SaveToXML(
    doc : XmlDocument, 
    events : IDTSInfoEvents
)

Paramètres

Implémente

IDTSComponentPersist. . :: . .SaveToXML(XmlDocument, IDTSInfoEvents)

Notes

This method, SaveToXML, is available because it is public on an interface that you inherit when you are creating custom objects and by objects shipped in the SSIS runtime. This method is intended for inheritance only and should not be called from code for other purposes. If you are creating a custom object and need information about how to write your own SaveToXML method, see Extension de packages avec des objets personnalisés.

If you want to save a package as XML, use the Application..::..SaveToXml method. If you want to save the package to the File System, use Application..::..SaveToDtsServer. If you want to save the package to the MSDB database, use Application..::..SaveToSqlServer or Application..::..SaveToSqlServerAs methods. When you call the Application..::..SaveToXml methods on the Application, the runtime will iterate through the tasks, connection managers, log providers, and all other objects that are contained by the package and call the SaveToXML method on each of them. The contained objects have code in their SaveToXML that creates an XmlElement for each property that the object must save, and a value for the element. The package contains the XmlDocument and the objects append their specific elements into the package’s XmlDocument. Therefore, you do not directly call the SaveToXML on the individual objects, but call the method on the Application object, and the runtime will cascade through the package objects and call the SaveToXML for you.