ASExecuteDDLTask.SaveToXML(XmlDocument, IDTSInfoEvents) Method


此方法不能由应用程序代码调用。This method is not callable by your application code. 若将包保存为 .xml,请使用 SaveToXml(String, Package, IDTSEvents) 方法。To save a package as .xml, use the SaveToXml(String, Package, IDTSEvents) method.

 virtual void SaveToXML(System::Xml::XmlDocument ^ doc, Microsoft::SqlServer::Dts::Runtime::IDTSInfoEvents ^ events);
public void SaveToXML (System.Xml.XmlDocument doc, Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents events);
abstract member SaveToXML : System.Xml.XmlDocument * Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents -> unit
override this.SaveToXML : System.Xml.XmlDocument * Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents -> unit
Public Sub SaveToXML (doc As XmlDocument, events As IDTSInfoEvents)



要将该信息保存到的 XML 文档。The XML document to which to save the information.


一个对象,该对象实现在持久性期间中用于引发事件(错误、警告等)的 IDTSInfoEvents 接口。An object that implements the IDTSInfoEvents interface for raising events (errors, warnings, and so on) during persistence.



此方法是 SaveToXML 可用的,因为它在创建自定义对象时继承的接口和 SSIS 运行时中交付的对象是公共的。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. 如果要创建自定义对象,并需要有关如何编写您自己的方法的信息 SaveToXML ,请参阅使用自定义对象扩展包If you are creating a custom object and need information about how to write your own SaveToXML method, see Extending Packages with Custom Objects.

如果要将包保存为 XML,请使用 Microsoft.SqlServer.Dts.Runtime.Application.SaveToXml 方法。If you want to save a package as XML, use the Microsoft.SqlServer.Dts.Runtime.Application.SaveToXml method. 如果要将包保存到文件系统,请使用 Microsoft.SqlServer.Dts.Runtime.Application.SaveToDtsServerIf you want to save the package to the File System, use Microsoft.SqlServer.Dts.Runtime.Application.SaveToDtsServer. 如果要将包保存到 MSDB 数据库,请使用 Microsoft.SqlServer.Dts.Runtime.Application.SaveToSqlServerMicrosoft.SqlServer.Dts.Runtime.Application.SaveToSqlServerAs 方法。If you want to save the package to the MSDB database, use Microsoft.SqlServer.Dts.Runtime.Application.SaveToSqlServer or Microsoft.SqlServer.Dts.Runtime.Application.SaveToSqlServerAs methods. 当你在 Microsoft.SqlServer.Dts.Runtime.Application.SaveToXml 上调用方法时 Application ,运行时将循环访问由包包含的任务、连接管理器、日志提供程序和所有其他对象,并对 SaveToXML 每个对象调用方法。When you call the Microsoft.SqlServer.Dts.Runtime.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. 所包含的对象在其中具有 SaveToXML 可为对象必须保存的每个属性创建 XmlElement 的代码,以及元素的值。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. 包中包含 Xml 文件,对象会将其特定元素附加到包的文件中。The package contains the XmlDocument and the objects append their specific elements into the package’s XmlDocument. 因此,您不会直接对 SaveToXML 单个对象调用,而是对对象调用方法 Application ,并且运行时将级联到包对象并 SaveToXML 为您调用。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.

Applies to