SaveToXml 方法
Saves the XML definition of a package to a file.
命名空间: Microsoft.SqlServer.Dts.Runtime
程序集: Microsoft.SqlServer.ManagedDTS(在 Microsoft.SqlServer.ManagedDTS.dll 中)
语法
声明
Public Sub SaveToXml ( _
fileName As String, _
package As Package, _
events As IDTSEvents _
)
用法
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
)
参数
- fileName
类型:System. . :: . .String
The name of the file to save.
- package
类型:Microsoft.SqlServer.Dts.Runtime. . :: . .Package
The package object to save.
- events
类型:Microsoft.SqlServer.Dts.Runtime. . :: . .IDTSEvents
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.
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