次の方法で共有


Properties プロパティ

ForEachLoop に関連付けられた DtsProperty オブジェクトのコレクションを返します。

名前空間:  Microsoft.SqlServer.Dts.Runtime
アセンブリ:  Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS.dll)

構文

'宣言
Public ReadOnly Property Properties As DtsProperties
    Get
'使用
Dim instance As ForEachLoop
Dim value As DtsProperties

value = instance.Properties
public DtsProperties Properties { get; }
public:
virtual property DtsProperties^ Properties {
    DtsProperties^ get () sealed;
}
abstract Properties : DtsProperties
override Properties : DtsProperties
final function get Properties () : DtsProperties

プロパティ値

型: Microsoft.SqlServer.Dts.Runtime. . :: . .DtsProperties
DtsProperties コレクションです。

実装

IDTSPropertiesProvider. . :: . .Properties

使用例

次のコード例では、ForEachLoop を作成し、Properties コレクションを使用していくつかのプロパティを設定します。次に、VariableMappings オブジェクトを作成し、VariableMappings を追加して変数に値をマップします。

// Create the new package.
Package package = new Package();
// Add variables.
package.Variables.Add("Id", false, "", 0);

// Create ForEachLoop task
Executables executables = package.Executables;
ForEachLoop forEachLoop = executables.Add("STOCK:FOREACHLOOP") as ForEachLoop;

// Set name and description properties on the ForEachLoop.
// Show how to set them using the Properties collection.
forEachLoop.Properties["Name"].SetValue(forEachLoop, "ForEachLoop Container");
forEachLoop.Properties["Description"].SetValue(forEachLoop, "ForEachLoop Container");

// Create a VariableMappings and VariableMapping objects.
ForEachVariableMappings forEachVariableMappings = forEachLoop.VariableMappings;
ForEachVariableMapping forEachVariableMapping = forEachVariableMappings.Add();

// Create a mapping between the variable and its value.
forEachVariableMapping.VariableName = "Id";
forEachVariableMapping.ValueIndex = 0;
' Create the new package.
Dim package As Package =  New Package() 
' Add variables.
package.Variables.Add("Id", False, "", 0)

' Create ForEachLoop task
Dim executables As Executables =  package.Executables 
Dim forEachLoop As ForEachLoop =  executables.Add("STOCK:FOREACHLOOP") as ForEachLoop

' Set name and description properties on the ForEachLoop.
' Show how to set them using the Properties collection.
forEachLoop.Properties("Name").SetValue(forEachLoop, "ForEachLoop Container")
forEachLoop.Properties("Description").SetValue(forEachLoop, "ForEachLoop Container")

Create a VariableMappings and VariableMapping objects.
Dim forEachVariableMappings As ForEachVariableMappings =  forEachLoop.VariableMappings 
Dim forEachVariableMapping As ForEachVariableMapping =  forEachVariableMappings.Add() 
 
' Create a mapping between the variable and its value.
forEachVariableMapping.VariableName = "Id"
forEachVariableMapping.ValueIndex = 0