PipelineBuffer.DirectRow(Int32) 方法

定义

PipelineBuffer 中的一行发送到指定的 IDTSOutput100

public:
 void DirectRow(int outputID);
public void DirectRow (int outputID);
member this.DirectRow : int -> unit
Public Sub DirectRow (outputID As Integer)

参数

outputID
Int32

发送 IDTSOutput100 行的 PipelineBuffer 的 ID。

示例

以下示例显示了一个组件,该组件包含同一排除组中的两个输出。 使用 ProcessInput 方法将行发送到输出的一个或多个输出 DirectRow

public override void ProvideComponentProperties()  
{  
    IDTSInput100 input = ComponentMetaData.InputCollection.New();  
    Input.Name = "DTSSampleInput";  

    IDTSOutput output = ComponentMetaData.OutputCollection.New();  
    output.ExclusionGroup = 1;  
    output.Name = "Output1";  
    output.SynchronousInputID = input.ID;  

    IDTSOutput output = ComponentMetaData.OutputCollection.New();  
    output.ExclusionGroup = 1;  
    output.Name = "Output2";  
    output.SynchronousInputID = input.ID;  
}  
public override void ProcessInput(int inputID, PipelineBuffer buffer)  
{  
    IDTSInput100 input = ComponentMetaData.InputCollection.GetObjectByID(inputID);  

    IDTSOutput100 output1 = ComponentMetaData.OutputCollection[0];  
    IDTSOutput100 output2 = ComponentMetaData.OutputCollection[1];  

    while( buffer.NextRow())  
    {  
        // TODO: Insert if/then block here.  
        // If criteria is met, direct the buffer row to output1.  
        buffer.DirectRow(output1.ID);  
        // Otherwise, direct the row to output2.  
         buffer.DirectRow(output2.ID);  
    }  
}  
Public Overrides Sub ProvideComponentProperties()   
 Dim input As IDTSInput100 = ComponentMetaData.InputCollection.New   
 Input.Name = "DTSSampleInput"   
 Dim output As IDTSOutput = ComponentMetaData.OutputCollection.New   
 output.ExclusionGroup = 1   
 output.Name = "Output1"   
 output.SynchronousInputID = input.ID   
 Dim output As IDTSOutput = ComponentMetaData.OutputCollection.New   
 output.ExclusionGroup = 1   
 output.Name = "Output2"   
 output.SynchronousInputID = input.ID   
End Sub   

Public  Overrides Sub ProcessInput(ByVal inputID As Integer, ByVal buffer As PipelineBuffer)   
 Dim input As IDTSInput100 = ComponentMetaData.InputCollection.GetObjectByID(inputID)   
 Dim output1 As IDTSOutput100 = ComponentMetaData.OutputCollection(0)   
 Dim output2 As IDTSOutput100 = ComponentMetaData.OutputCollection(1)   
While buffer.NextRow   
  ' TODO: Insert if/then block here.  
  ' If criteria is met, direct the buffer row to output1.  
   buffer.DirectRow(output1.ID)   
  ' Otherwise, direct the row to output2.  
   buffer.DirectRow(output2.ID)   
 End While   
End Sub  

注解

该方法 DirectRow 由包含同一 ExclusionGroup个输出的组件调用。 它用于将行 PipelineBuffer 定向到指定的输出-组件中的特定输出。 此方法可用于错误和非错误输出,但是, DirectErrorRow 该方法应用于将行发送到错误输出。

如果同一排除组中有两个同步输出的组件使用 NextRow 该方法将缓冲区推进到下一行,而不将行定向到特定输出,则该行将发送到这两个输出。

适用于