ForEachLoop.GetPackagePath メソッド
パッケージの場所の相対パスを表す String を返します。
名前空間: Microsoft.SqlServer.Dts.Runtime
アセンブリ: Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS.dll)
構文
'宣言
Public Function GetPackagePath As String
'使用
Dim instance As ForEachLoop
Dim returnValue As String
returnValue = instance.GetPackagePath()
public string GetPackagePath()
public:
virtual String^ GetPackagePath() sealed
abstract GetPackagePath : unit -> string
override GetPackagePath : unit -> string
public final function GetPackagePath() : String
戻り値
型: System.String
パッケージへのパスを表す String です。
実装
IDTSPackagePath.GetPackagePath()
使用例
次のコード例では、ForEachLoop を作成し、Properties コレクションを使用していくつかのプロパティを設定し、パッケージのパスを取得します。
// Create the new package.
Package package = new Package();
// Add variables.
package.Variables.Add("Id", false, "User", 0);
// Create ForEachLoop task
Executables executables = package.Executables;
ForEachLoop forEachLoop = executables.Add("STOCK:FOREACHLOOP") as ForEachLoop;
// Set properties on the ForEachLoop, like name and description.
// Show how to set them using the Properties collection.
forEachLoop.Properties["Name"].SetValue(forEachLoop, "ForEachLoop Container");
forEachLoop.Properties["Description"].SetValue(forEachLoop, "ForEachLoop Container");
// Retrieve the package path of the loop.
String path = forEachLoop.GetPackagePath();
Console.WriteLine("Package path: {0}", path);
' Create the new package.
Dim package As Package = New Package()
' Add variables.
package.Variables.Add("Id", False, "User", 0)
' Create ForEachLoop task
Dim executables As Executables = package.Executables
Dim forEachLoop As ForEachLoop = executables.Add("STOCK:FOREACHLOOP") as ForEachLoop
' Set properties on the ForEachLoop, like name and description.
' Show how to set them using the Properties collection.
forEachLoop.Properties("Name").SetValue(forEachLoop, "ForEachLoop Container")
forEachLoop.Properties("Description").SetValue(forEachLoop, "ForEachLoop Container")
' Retrieve the package path of the loop.
Dim path As String = forEachLoop.GetPackagePath()
Console.WriteLine("Package path: {0}", path)
サンプル出力:
Package path: \Package\ForEachLoop Container