CManagedComponentWrapperClass.SetUsageType 方法

定义

IDTSInputColumnCollection100组件中创建一个IDTSInputColumn100对象,并设置列的 UsageType 属性。

public:
 virtual Microsoft::SqlServer::Dts::Pipeline::Wrapper::IDTSInputColumn100 ^ SetUsageType(int lInputID, Microsoft::SqlServer::Dts::Pipeline::Wrapper::IDTSVirtualInput100 ^ pIDTSVirtualInputObject, int lLineageID, Microsoft::SqlServer::Dts::Pipeline::Wrapper::DTSUsageType eUsageType) = Microsoft::SqlServer::Dts::Pipeline::Wrapper::IDTSDesigntimeComponent100::SetUsageType;
[System.Runtime.InteropServices.DispId(16)]
public virtual Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSInputColumn100 SetUsageType (int lInputID, Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSVirtualInput100 pIDTSVirtualInputObject, int lLineageID, Microsoft.SqlServer.Dts.Pipeline.Wrapper.DTSUsageType eUsageType);
[<System.Runtime.InteropServices.DispId(16)>]
abstract member SetUsageType : int * Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSVirtualInput100 * int * Microsoft.SqlServer.Dts.Pipeline.Wrapper.DTSUsageType -> Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSInputColumn100
override this.SetUsageType : int * Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSVirtualInput100 * int * Microsoft.SqlServer.Dts.Pipeline.Wrapper.DTSUsageType -> Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSInputColumn100
Public Overridable Function SetUsageType (lInputID As Integer, pIDTSVirtualInputObject As IDTSVirtualInput100, lLineageID As Integer, eUsageType As DTSUsageType) As IDTSInputColumn100

参数

lInputID
Int32

IDTSInput100 对象的 ID。

pIDTSVirtualInputObject
IDTSVirtualInput100

IDTSVirtualInput100 对象。

lLineageID
Int32

LineageID 对象的 IDTSVirtualInputColumn100

eUsageType
DTSUsageType

输入列的使用类型。

返回

IDTSInputColumn100设置其使用类型;如果从集合中删除列,则为 null。

实现

属性

示例

下面的代码示例演示如何 SetUsageType 从组件使用的上游组件中选择列。 该示例假定包已创建或加载,并且数据流任务和组件已添加到包。

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);  
}  

注解

此方法用于从组件使用的数据流图中的上游组件中选择列。 调用此方法可添加或删除IDTSInputColumn100InputColumnCollection组件。 它还指定组件是否具有对列的只读访问权限,或者它是否可以覆盖执行期间列的值。

如果 eusageTypeUT_READONLYUT_READWRITE,组件会将该列添加到其输入列集合中,并在执行期间向数据流引擎提供该列。 如果 UT_IGNORED 已指定,并且以前已将列添加到集合中,则会删除该列。

适用于