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,且該欄位先前已被加入集合,則該欄位將被移除。

適用於