CManagedComponentWrapperClass.SetUsageType Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Parameters
- lInputID
- Int32
- pIDTSVirtualInputObject
- IDTSVirtualInput100
- lLineageID
- Int32
- eUsageType
- DTSUsageType
Returns
The IDTSInputColumn100 whose usage type is set, or null
if the column was removed from the collection.
Implements
- Attributes
Examples
The following code example shows how SetUsageType is used to select the columns from the upstream component that are used by the component. The example assumes that the package has already been created or loaded, and that the data flow task and components have been added to the package.
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);
}
Remarks
This method is used to select the columns from the upstream component in the data flow graph that are used by the component. Call this method to add or remove an IDTSInputColumn100 from the InputColumnCollection of the component. It also specifies whether the component has read-only access to the column or if it can overwrite the values of the column during execution.
If eusageType is UT_READONLY or UT_READWRITE, the component adds the column to its input column collection and provides the column to the data flow engine during execution. If UT_IGNORED is specified, and the column has previously been added to the collection, the column is removed.