Export (0) Print
Expand All

PipelineComponent.VariableDispenser Property

Gets the IDTSVariableDispenser100 of the data flow component.

This API is not CLS-compliant. 

Namespace:  Microsoft.SqlServer.Dts.Pipeline
Assembly:  Microsoft.SqlServer.PipelineHost (in Microsoft.SqlServer.PipelineHost.dll)

public IDTSVariableDispenser100 VariableDispenser { get; }

The VariableDispenser is used to read and write variables in the package that contains the component. Before reading or writing a variable, it must be locked using one of the following methods; LockForRead, LockForWrite, LockOneForRead, or LockOneForWrite. After the variables are locked using the dispenser, they are available through the IDTSVariables100 interface.

The following example demonstrates how to use the VariableDispenser to lock a single variable, and multiple variables.

// Lock two variables, and then retrieve them by calling GetVariables.
IDTSVariables100 variables = null;

VariableDispenser.GetVariables(ref variables);

object variable1 = variables[0].Value;
object variable2 = variables[1].Value;

// Retrieve a single variable.
IDTSVariables100 variables = null;
VariableDispenser.LockOneForRead("variable1", ref variables);

object variable1 = variables[0].Value;
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft