CManagedComponentWrapperClass.SetUsageType 方法

定义

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

参数

lInputID
Int32
pIDTSVirtualInputObject
IDTSVirtualInput100
lLineageID
Int32
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);  
}  

注解

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

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

适用于