共用方式為


IDTSOutput100.ExclusionGroup Property

Definition

Gets or sets the ExclusionGroup property of an IDTSOutput100 object.

public:
 property int ExclusionGroup { int get(); void set(int value); };
[System.Runtime.InteropServices.DispId(101)]
public int ExclusionGroup { [System.Runtime.InteropServices.DispId(101)] get; [System.Runtime.InteropServices.DispId(101)] set; }
[<System.Runtime.InteropServices.DispId(101)>]
[<get: System.Runtime.InteropServices.DispId(101)>]
[<set: System.Runtime.InteropServices.DispId(101)>]
member this.ExclusionGroup : int with get, set
Public Property ExclusionGroup As Integer

Property Value

The ExclusionGroup of the IDTSOutput100 object.

Attributes

Examples

The following code example demonstrates how the ExclusionGroup property is used when a data flow component has two outputs in the same exclusion group and the same synchronous input.

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())  
    {  
        // 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   
   buffer.DirectRow(output1.ID)   
   buffer.DirectRow(output2.ID)   
 End While   
End Sub  

Remarks

The ExclusionGroup property is set when two outputs are synchronous to the same IDTSInput100 object and you want to direct rows exclusively to one output or to the other. Both outputs must have the same value for their SynchronousInputID properties and for their ExclusionGroup properties. You must set this property to a nonzero value if you want to use an exclusion group; otherwise, leave the default value of zero.

During execution, data flow components that have multiple outputs with the same synchronous input and the same nonzero exclusion group direct rows from the input PipelineBuffer to one of the outputs using the DirectRow method, or, when the IsErrorOut property is true, the DirectErrorRow method.

Applies to