ForEachLoop.Properties Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Devuelve una colección de objetos DtsProperty asociados al bucle ForEachLoop.
public:
property Microsoft::SqlServer::Dts::Runtime::DtsProperties ^ Properties { Microsoft::SqlServer::Dts::Runtime::DtsProperties ^ get(); };
public Microsoft.SqlServer.Dts.Runtime.DtsProperties Properties { get; }
member this.Properties : Microsoft.SqlServer.Dts.Runtime.DtsProperties
Public ReadOnly Property Properties As DtsProperties
Valor de propiedad
Colección DtsProperties.
Implementaciones
Ejemplos
En el ejemplo de código siguiente se crea un ForEachLoopobjeto , se establecen algunas propiedades mediante la Properties colección , se crea un VariableMappings objeto y se agrega un VariableMappings objeto donde se asigna una variable a un valor .
// 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