PipelineBuffer.SetEndOfRowset 方法

定义

PipelineBuffer 通知组件已完成向缓冲区添加行。

public:
 void SetEndOfRowset();
public void SetEndOfRowset ();
member this.SetEndOfRowset : unit -> unit
Public Sub SetEndOfRowset ()

示例

以下示例演示了一个源组件,该组件调用 SetEndOfRowset 以指示它已完成向该 PipelineBuffer组件添加行。

using System;  
using Microsoft.SqlServer.Dts.Pipeline;  
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;  
using Microsoft.SqlServer.Dts.Runtime.Wrapper;  

namespace Microsoft.Samples.SqlServer.Dts  
{  
  [DtsPipelineComponent(DisplayName = "SampleComponent")]  
  public class SampleSourceComponent: PipelineComponent  
  {  

    public override void ProvideComponentProperties()  
    {  
    IDTSOutput100 output = ComponentMetaData.OutputCollection.New();  
    output.Name = "SourceOutput";  

    IDTSOutputColumn100 column = output.OutputColumnCollection.New();  
    column.Name = "Column1";  
    column.SetDataTypeProperties(DataType.DT_R8, 0, 0, 0, 0);  
    }  

    public override void PrimeOutput(int outputs, int[] outputIDs, PipelineBuffer[] buffers)  
    {  
      double d = 123.5;  
      buffers[0].AddRow();  
      buffers[0].SetDouble(0, d);  
      buffers[0].SetEndOfRowset();  
    }  
  }  
}  
Imports System   
Imports Microsoft.SqlServer.Dts.Pipeline   
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper   
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper   
Namespace Microsoft.Samples.SqlServer.Dts   

 <DtsPipelineComponent(DisplayName="SampleComponent")> _   
 Public Class SampleSourceComponent   
 Inherits PipelineComponent   

   Public  Overrides Sub ProvideComponentProperties()   
     Dim output As IDTSOutput100 = ComponentMetaData.OutputCollection.New   
     output.Name = "SourceOutput"   
     Dim column As IDTSOutputColumn100 = output.OutputColumnCollection.New   
     column.Name = "Column1"   
     column.SetDataTypeProperties(DataType.DT_R8, 0, 0, 0, 0)   
   End Sub   

   Public  Overrides Sub PrimeOutput(ByVal outputs As Integer, ByVal outputIDs As Integer(), ByVal buffers As PipelineBuffer())   
     Dim d As Double = 123.5   
     buffers(0).AddRow   
     buffers(0).SetDouble(0, d)   
     buffers(0).SetEndOfRowset   
   End Sub   
 End Class   
End Namespace  

注解

数据流组件在完成向行 OutputPipelineBuffer添加后调用此方法。 调用 SetEndOfRowset 通知数据流引擎组件已完成向该组件添加行 PipelineBuffer。 然后,该方法 SetEndOfRowsetEndOfRowset 属性的值设置为 true 最终缓冲区。

生成 PipelineBuffer 一个 NotOutputBufferException 何时 ModePipelineBufferInput 调用此方法。

适用于