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

已設定使用類型的 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_READONLYUT_READWRITE,則元件會將資料行加入至其輸入資料行集合,並在執行期間將資料行提供給資料流程引擎。 如果指定了 UT_IGNORED ,而且先前已將資料行加入至集合,則會移除該資料行。

適用於