Поделиться через


Свойство PipelineComponent.VariableDispenser

Gets the IDTSVariableDispenser100 of the data flow component.

Этот API-интерфейс несовместим с CLS. 

Пространство имен:  Microsoft.SqlServer.Dts.Pipeline
Сборка:  Microsoft.SqlServer.PipelineHost (в Microsoft.SqlServer.PipelineHost.dll)

Синтаксис

'Декларация
<CLSCompliantAttribute(False)> _
Public ReadOnly Property VariableDispenser As IDTSVariableDispenser100 
    Get
'Применение
Dim instance As PipelineComponent 
Dim value As IDTSVariableDispenser100 

value = instance.VariableDispenser
[CLSCompliantAttribute(false)]
public IDTSVariableDispenser100 VariableDispenser { get; }
[CLSCompliantAttribute(false)]
public:
property IDTSVariableDispenser100^ VariableDispenser {
    IDTSVariableDispenser100^ get ();
}
[<CLSCompliantAttribute(false)>]
member VariableDispenser : IDTSVariableDispenser100
function get VariableDispenser () : IDTSVariableDispenser100

Значение свойства

Тип: Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSVariableDispenser100
The IDTSVariableDispenser100 object provided to the component.

Замечания

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.LockForRead("variable1");
VariableDispenser.LockForRead("variable2");
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;
' Lock two variables, and then retrieve them by calling GetVariables.
Dim variables As IDTSVariables100 = Nothing 
VariableDispenser.LockForRead("variable1") 
VariableDispenser.LockForRead("variable2") 
VariableDispenser.GetVariables(variables) 
Dim variable1 As Object = variables(0).Value 
Dim variable2 As Object = variables(1).Value 
Dim variables As IDTSVariables100 = Nothing 
VariableDispenser.LockOneForRead("variable1", variables) 
Dim variable1 As Object = variables(0).Value

См. также

Справочник

PipelineComponent Класс

Пространство имен Microsoft.SqlServer.Dts.Pipeline