Share via


PipelineComponent.SetUsageType Method

Creates an IDTSInputColumn90 object in the IDTSInputColumnCollection90 of the component and sets the UsageType property of the column. This method is not CLS-compliant.

네임스페이스: Microsoft.SqlServer.Dts.Pipeline
어셈블리: Microsoft.SqlServer.PipelineHost (in microsoft.sqlserver.pipelinehost.dll)

구문

‘선언
<CLSCompliantAttribute(False)> _
Public Overridable Function SetUsageType ( _
    inputID As Integer, _
    virtualInput As IDTSVirtualInput90, _
    lineageID As Integer, _
    usageType As DTSUsageType _
) As IDTSInputColumn90
[CLSCompliantAttribute(false)] 
public virtual IDTSInputColumn90 SetUsageType (
    int inputID,
    IDTSVirtualInput90 virtualInput,
    int lineageID,
    DTSUsageType usageType
)
[CLSCompliantAttribute(false)] 
public:
virtual IDTSInputColumn90^ SetUsageType (
    int inputID, 
    IDTSVirtualInput90^ virtualInput, 
    int lineageID, 
    DTSUsageType usageType
)
/** @attribute CLSCompliantAttribute(false) */ 
public IDTSInputColumn90 SetUsageType (
    int inputID, 
    IDTSVirtualInput90 virtualInput, 
    int lineageID, 
    DTSUsageType usageType
)
CLSCompliantAttribute(false) 
public function SetUsageType (
    inputID : int, 
    virtualInput : IDTSVirtualInput90, 
    lineageID : int, 
    usageType : DTSUsageType
) : IDTSInputColumn90

매개 변수

  • inputID
    The ID of the IDTSInput90 object.
  • virtualInput
    The IDTSVirtualInput90 object that is used to map the IDTSInputColumn90 object.

반환 값

The IDTSInputColumn90 object whose UsageType is set.

주의

If usageType is UT_READONLY or UT_READWRITE, the base class adds the column to the input column collection of the component; if it is UT_IGNORED, the existing column is removed. Override this method to restrict the columns that are added to the component based on the data type, or usage type, of the column.

The following example prevents users of the component from setting the usage type of a column to read-only.

public override IDTSInputColumn90 SetUsageType(int inputID, IDTSVirtualInput90 virtualInput, int lineageID, DTSUsageType usageType)
{
    // Prevent columns from being set to Read Only.
    if ( usageType == DTSUsageType.UT_READONLY )
        throw new Exception( "The UsageType must be set to ReadWrite.");

    // Otherwise let the base class add or remove the column.
    return base.SetUsageType (inputID, virtualInput, lineageID, usageType);

}
Public Overrides Function SetUsageType(ByVal inputID As Integer, ByVal virtualInput As IDTSVirtualInput90, ByVal lineageID As Integer, ByVal usageType As DTSUsageType) As IDTSInputColumn90 
 If usageType = DTSUsageType.UT_READONLY Then 
   Throw New Exception("The UsageType must be set to ReadWrite.") 
 End If 
 Return MyBase.SetUsageType(inputID, virtualInput, lineageID, usageType) 
End Function

스레드 보안

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

PipelineComponent Class
PipelineComponent Members
Microsoft.SqlServer.Dts.Pipeline Namespace