IDTSVirtualInput90 Interface
Represents the columns available to a component from the upstream component.
Spazio dei nomi: Microsoft.SqlServer.Dts.Pipeline.Wrapper
Assembly : Microsoft.SqlServer.DTSPipelineWrap (in microsoft.sqlserver.dtspipelinewrap.dll)
Sintassi
'Dichiarazione
<GuidAttribute("B9A5E5EB-4BFC-48AF-95E9-6344C6794340")> _
<TypeLibTypeAttribute(4160)> _
Public Interface IDTSVirtualInput90
Inherits IDTSObject90
[GuidAttribute("B9A5E5EB-4BFC-48AF-95E9-6344C6794340")]
[TypeLibTypeAttribute(4160)]
public interface IDTSVirtualInput90 : IDTSObject90
[GuidAttribute(L"B9A5E5EB-4BFC-48AF-95E9-6344C6794340")]
[TypeLibTypeAttribute(4160)]
public interface class IDTSVirtualInput90 : IDTSObject90
/** @attribute GuidAttribute("B9A5E5EB-4BFC-48AF-95E9-6344C6794340") */
/** @attribute TypeLibTypeAttribute(4160) */
public interface IDTSVirtualInput90 extends IDTSObject90
GuidAttribute("B9A5E5EB-4BFC-48AF-95E9-6344C6794340")
TypeLibTypeAttribute(4160)
public interface IDTSVirtualInput90 extends IDTSObject90
Osservazioni
The IDTSVirtualInput90 is retrieved by calling the GetVirtualInput method of an IDTSInput90 object. The VirtualInputColumnCollection property contains the columns that are available from the upstream components in the graph.
When programmatically building a data flow task, the virtual columns are selected for a component by calling the SetUsageType method of the CManagedComponentWrapperClass.
Developers writing custom data flow components use the virtual input to discover the available upstream columns, and, depending on the component, to add columns to the input based on the columns in the virtual collection.
Because the virtual input is a reflection of upstream columns, modifications to the virtual input or the columns in the virtual input collection do not have any impact on the IDTSOutput90 itself.
Esempio
The following code example shows how to use the virtual input to select the columns used by a component when programmatically building the data flow task.
public void SelectColumns(IDTSComponentMetaData90 md)
{
// Create the design time instance of the component.
CManagedComponentWrapper wrp = md.Instantiate();
// Walk the input collection.
foreach (IDTSInput90 input in md.InputCollection)
{
// Get the virtual input columns.
IDTSVirtualInput90 vInput = input.GetVirtualInput();
// For each virtual column, set its usagetype to READONLY.
foreach (IDTSVirtualInputColumn90 vCol in vInput.VirtualInputColumnCollection)
wrp.SetUsageType(input.ID, vInput, vCol.LineageID, DTSUsageType.UT_READONLY);
}
}
Public Sub SelectColumns(ByVal md As IDTSComponentMetaData90)
Dim wrp As CManagedComponentWrapper = md.Instantiate
For Each input As IDTSInput90 In md.InputCollection
Dim vInput As IDTSVirtualInput90 = input.GetVirtualInput
For Each vCol As IDTSVirtualInputColumn90 In vInput.VirtualInputColumnCollection
wrp.SetUsageType(input.ID, vInput, vCol.LineageID, DTSUsageType.UT_READONLY)
Next
Next
End Sub
The following code example shows a custom data flow component that selects all of the DT_STR columns from the virtual input when the input is connected to a path.
public override void OnInputPathAttached(int inputID)
{
IDTSInput90 input = ComponentMetaData.InputCollection.GetObjectByID(inputID);
IDTSVirtualInput90 vInput = input.GetVirtualInput();
foreach (IDTSVirtualInputColumn90 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 IDTSInput90 = ComponentMetaData.InputCollection.GetObjectByID(inputID)
Dim vInput As IDTSVirtualInput90 = input.GetVirtualInput
For Each vCol As IDTSVirtualInputColumn90 In vInput.VirtualInputColumnCollection
If vCol.DataType = DataType.DT_STR Then
Me.SetUsageType(inputID, vInput, vCol.LineageID, DTSUsageType.UT_READONLY)
End If
Next
End Sub
Piattaforme
Piattaforme di sviluppo
Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.
Piattaforme di destinazione
Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.
Vedere anche
Riferimento
IDTSVirtualInput90 Members
Microsoft.SqlServer.Dts.Pipeline.Wrapper Namespace