Aracılığıyla paylaş


PipelineBuffer.DirectRow Yöntemi

Bir satırdan gönderen bir PipelineBuffer belirtilen IDTSOutput100.

Ad Alanı:  Microsoft.SqlServer.Dts.Pipeline
Derleme:  Microsoft.SqlServer.PipelineHost (Microsoft.SqlServer.PipelineHost içinde.dll)

Sözdizimi

'Bildirim
Public Sub DirectRow ( _
    outputID As Integer _
)
'Kullanım
Dim instance As PipelineBuffer
Dim outputID As Integer

instance.DirectRow(outputID)
public void DirectRow(
    int outputID
)
public:
void DirectRow(
    int outputID
)
member DirectRow : 
        outputID:int -> unit 
public function DirectRow(
    outputID : int
)

Parametreler

Açıklamalar

DirectRow Tarafından bileşenleri içeren birden fazla çıkışı aynı yöntem çağrılır ExclusionGroup.Yönlendirmek için kullanılan bir PipelineBuffer Belirtilen çıkış satırına — belirli bir çıktı bileşen.Bu yöntem için hata ve hata çıkışları, ancak kullanılabilir, DirectErrorRow satırlara gönderme yöntemi kullanılmalıdırbir hata çıktı.

Sonraki satır için kullanılacak bir arabellek aynı dışlama grup içinde iki zaman uyumlu olan bir bileşen çıktılarında, ilerletir NextRow yöntem belirli bir çıkış satıra suna olmadan satır gönderildiği her iki çıkış verir.

Örnekler

Aşağıdaki örnek, aynı dışlama grubunda iki çıkışlar içeren bir bileşeni gösterir.Sırasında ProcessInput veya bir diğeri çıkışları kullanarak satır gönderilir DirectRow yöntem.

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