Application.LoadFromDtsServer メソッド
指定したサーバーからパッケージを読み込みます。
名前空間: Microsoft.SqlServer.Dts.Runtime
アセンブリ: Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS.dll)
構文
'宣言
Public Function LoadFromDtsServer ( _
sPackagePath As String, _
sServerName As String, _
pEvents As IDTSEvents _
) As Package
'使用
Dim instance As Application
Dim sPackagePath As String
Dim sServerName As String
Dim pEvents As IDTSEvents
Dim returnValue As Package
returnValue = instance.LoadFromDtsServer(sPackagePath, _
sServerName, pEvents)
public Package LoadFromDtsServer(
string sPackagePath,
string sServerName,
IDTSEvents pEvents
)
public:
Package^ LoadFromDtsServer(
String^ sPackagePath,
String^ sServerName,
IDTSEvents^ pEvents
)
member LoadFromDtsServer :
sPackagePath:string *
sServerName:string *
pEvents:IDTSEvents -> Package
public function LoadFromDtsServer(
sPackagePath : String,
sServerName : String,
pEvents : IDTSEvents
) : Package
パラメーター
- sPackagePath
型: System.String
パッケージの完全修飾パスです。
- sServerName
型: System.String
パッケージが格納されているサーバーです。
- pEvents
型: Microsoft.SqlServer.Dts.Runtime.IDTSEvents
IDTSEvents インターフェイスです。
戻り値
型: Microsoft.SqlServer.Dts.Runtime.Package
Package オブジェクトです。
使用例
次のコード例では、Integration Services サービスの [ファイル システム] フォルダーに以前保存された myp1Package および myp2Package という名前の 2 つのパッケージを取得します。
static void Main(string[] args)
{
Application app = new Application();
// Load the packages.
Package p1 = app.LoadFromDtsServer(@"File System\myp1Package", "yourserver", null);
Package p2 = app.LoadFromDtsServer(@"File System\myp2Package", "yourserver", null);
// Retrieve the ID (GUID) from the packages for display.
String p1_ID = p1.ID;
String p2_ID = p2.ID;
Console.WriteLine("ID for myp1Package = " + p1_ID);
Console.WriteLine("ID for myp2Package = " + p2_ID);
}
Sub Main(ByVal args() As String)
Dim app As Application = New Application()
' Load the packages.
Dim p1 As Package = app.LoadFromDtsServer("File System\myp1Package","yourserver",Nothing)
Dim p2 As Package = app.LoadFromDtsServer("File System\myp2Package","yourserver",Nothing)
' Retrieve the ID (GUID) from the packages for display.
Dim p1_ID As String = p1.ID
Dim p2_ID As String = p2.ID
Console.WriteLine("ID for myp1Package = " + p1_ID)
Console.WriteLine("ID for myp2Package = " + p2_ID)
End Sub
サンプル出力:
ID for myp1Package = {598607C7-9C17-487D-A545-8D1C35FBF6E2}
ID for myp2Package = {F0D2E396-A6A5-42AE-9467-04CE946A810C}