IDTSVirtualInput100 接口

定义

public interface class IDTSVirtualInput100 : Microsoft::SqlServer::Dts::Pipeline::Wrapper::Sql2014::IDTSObject100
[System.Runtime.InteropServices.Guid("DD9E7F1F-A112-4EBD-9178-EE7DB0F2EDEC")]
[System.Runtime.InteropServices.TypeLibType(System.Runtime.InteropServices.TypeLibTypeFlags.FDispatchable | System.Runtime.InteropServices.TypeLibTypeFlags.FDual)]
public interface IDTSVirtualInput100 : Microsoft.SqlServer.Dts.Pipeline.Wrapper.Sql2014.IDTSObject100
[<System.Runtime.InteropServices.Guid("DD9E7F1F-A112-4EBD-9178-EE7DB0F2EDEC")>]
[<System.Runtime.InteropServices.TypeLibType(System.Runtime.InteropServices.TypeLibTypeFlags.FDispatchable | System.Runtime.InteropServices.TypeLibTypeFlags.FDual)>]
type IDTSVirtualInput100 = interface
    interface IDTSObject100
Public Interface IDTSVirtualInput100
Implements IDTSObject100
属性
实现

示例

下面的代码示例演示如何在以编程方式生成数据流任务时使用虚拟输入来选择组件所使用的列。

Public Sub SelectColumns(ByVal md As IDTSComponentMetaData100)   
 Dim wrp As CManagedComponentWrapper = md.Instantiate   
 For Each input As IDTSInput100 In md.InputCollection   
   Dim vInput As IDTSVirtualInput100 = input.GetVirtualInput   
   For Each vCol As IDTSVirtualInputColumn100 In vInput.VirtualInputColumnCollection   
     wrp.SetUsageType(input.ID, vInput, vCol.LineageID, DTSUsageType.UT_READONLY)   
   Next   
 Next   
End Sub  
public void SelectColumns(IDTSComponentMetaData100 md)  
{  
    // Create the design time instance of the component.  
    CManagedComponentWrapper wrp = md.Instantiate();  

    // Walk the input collection.  
    foreach (IDTSInput100 input in md.InputCollection)  
    {  
        // Get the virtual input columns.  
        IDTSVirtualInput100 vInput = input.GetVirtualInput();  

        // For each virtual column, set its usagetype to READONLY.  
        foreach (IDTSVirtualInputColumn100 vCol in vInput.VirtualInputColumnCollection)  
            wrp.SetUsageType(input.ID, vInput, vCol.LineageID, DTSUsageType.UT_READONLY);  
    }  
}  

下面的代码示例演示一个自定义数据流组件,该组件在输入连接到路径时从虚拟输入中选择所有 DT_STR 列。

public override void OnInputPathAttached(int inputID)  
{  
    IDTSInput100 input = ComponentMetaData.InputCollection.GetObjectByID(inputID);  
    IDTSVirtualInput100 vInput = input.GetVirtualInput();  

    foreach (IDTSVirtualInputColumn100 vCol in vInput.VirtualInputColumnCollection)  
    {  
        if (vCol.DataType == DataType.DT_STR)  
        {  
            this.SetUsageType(inputID, vInput, vCol.LineageID, DTSUsageType.UT_READONLY);  
        }  
    }  
}  
Public Overrides Sub OnInputPathAttached(ByVal inputID As Integer)   
 Dim input As IDTSInput100 = ComponentMetaData.InputCollection.GetObjectByID(inputID)   
 Dim vInput As IDTSVirtualInput100 = input.GetVirtualInput   
 For Each vCol As IDTSVirtualInputColumn100 In vInput.VirtualInputColumnCollection   
   If vCol.DataType = DataType.DT_STR Then   
     Me.SetUsageType(inputID, vInput, vCol.LineageID, DTSUsageType.UT_READONLY)   
   End If   
 Next   
End Sub  

注解

IDTSVirtualInput100 通过调用对象的方法来检索 GetVirtualInput IDTSInput100VirtualInputColumnCollection属性包含关系图中的上游组件可用的列。

以编程方式生成数据流任务时,会通过调用的方法为组件选择虚拟列 SetUsageType CManagedComponentWrapperClass

编写自定义数据流组件的开发人员使用虚拟输入来发现可用的上游列,并根据组件将列添加到基于虚拟集合中的列的输入中。

由于虚拟输入是上游列的反射,对虚拟输入集合中的虚拟输入或列的修改对其自身没有任何影响 IDTSOutput100

属性

Description
ID
IdentificationString
IsSorted
Name
ObjectType
SourceLocale
VirtualInputColumnCollection

方法

SetUsageType(Int32, DTSUsageType)

适用于