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


Метод CManagedComponentWrapperClass.SetUsageType

Creates an IDTSInputColumn100 object in the IDTSInputColumnCollection100 of the component and sets the UsageType property of the column.

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

Синтаксис

'Декларация
Public Overridable Function SetUsageType ( _
    lInputID As Integer, _
    pIDTSVirtualInputObject As IDTSVirtualInput100, _
    lLineageID As Integer, _
    eUsageType As DTSUsageType _
) As IDTSInputColumn100
'Применение
Dim instance As CManagedComponentWrapperClass 
Dim lInputID As Integer 
Dim pIDTSVirtualInputObject As IDTSVirtualInput100 
Dim lLineageID As Integer 
Dim eUsageType As DTSUsageType 
Dim returnValue As IDTSInputColumn100 

returnValue = instance.SetUsageType(lInputID, _
    pIDTSVirtualInputObject, lLineageID, _
    eUsageType)
public virtual IDTSInputColumn100 SetUsageType(
    int lInputID,
    IDTSVirtualInput100 pIDTSVirtualInputObject,
    int lLineageID,
    DTSUsageType eUsageType
)
public:
virtual IDTSInputColumn100^ SetUsageType(
    [InAttribute] int lInputID, 
    [InAttribute] IDTSVirtualInput100^ pIDTSVirtualInputObject, 
    [InAttribute] int lLineageID, 
    [InAttribute] DTSUsageType eUsageType
)
abstract SetUsageType : 
        lInputID:int * 
        pIDTSVirtualInputObject:IDTSVirtualInput100 * 
        lLineageID:int * 
        eUsageType:DTSUsageType -> IDTSInputColumn100  
override SetUsageType : 
        lInputID:int * 
        pIDTSVirtualInputObject:IDTSVirtualInput100 * 
        lLineageID:int * 
        eUsageType:DTSUsageType -> IDTSInputColumn100
public function SetUsageType(
    lInputID : int, 
    pIDTSVirtualInputObject : IDTSVirtualInput100, 
    lLineageID : int, 
    eUsageType : DTSUsageType
) : IDTSInputColumn100

Параметры

Возвращаемое значение

Тип: Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSInputColumn100
The IDTSInputColumn100 whose usage type is set, or nullпустая ссылка (Nothing в Visual Basic) if the column was removed from the collection.

Реализует

IDTSDesigntimeComponent100.SetUsageType(Int32, IDTSVirtualInput100, Int32, DTSUsageType)

Замечания

This method is used to select the columns from the upstream component in the data flow graph that are used by the component. Call this method to add or remove an IDTSInputColumn100 from the InputColumnCollection of the component. It also specifies whether the component has read-only access to the column or if it can overwrite the values of the column during execution.

If eusageType is UT_READONLY or UT_READWRITE, the component adds the column to its input column collection and provides the column to the data flow engine during execution. If UT_IGNORED is specified, and the column has previously been added to the collection, the column is removed.

Примеры

The following code example shows how SetUsageType is used to select the columns from the upstream component that are used by the component. The example assumes that the package has already been created or loaded, and that the data flow task and components have been added to the package.

IDTSComponentMetaData100 md = dataFlow.ComponentMetaDataCollection[1];
CManagedComponentWrapper wrp = md.Instantiate();
IDTSInput100 input = md.InputCollection[0];
IDTSVirtualInput100 vInput = input.GetVirtualInput();

foreach(IDTSVirtualInputColumn100 vCol in vInput.VirtualInputColumnCollection)
{
    wrp.SetUsageType(input.ID,vInput,vCol.LineageID,DTSUsageType.UT_READWRITE);
}

См. также

Справочник

CManagedComponentWrapperClass Класс

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