Send feedback on this topic.
Teradata.Client.Provider
GetEnumerator Method (TdQueryBand)
Example 



Teradata.Client.Provider Namespace > TdQueryBand Class : GetEnumerator Method
Returns an enumerator that is used to iterate through all the defined Query Bands.
Syntax
'Declaration
 
Public Function GetEnumerator() As IEnumerator(Of KeyValuePair(Of String,Object))
'Usage
 
Dim instance As TdQueryBand
Dim value As IEnumerator(Of KeyValuePair(Of String,Object))
 
value = instance.GetEnumerator()

Return Value

Returns an enumerator.
Remarks

When using the enumerator to iterate through the Query Bands, each item is a KeyValuePair<String, Object>. (Collections.Generic.KeyValuePair`2 for more information).

For further information refer to Collections.Generic.IEnumerable`1.GetEnumerator.

Example
The following example iterates through Query Bands, and will have the following output:

Key = ProxyUser, Value = user1
Key = Group, Value = gardening
Key = ApplicationName, Value = Accounting
public void EnumerationExample()
{
    TdQueryBand queryBand = new TdQueryBand("ProxyUser = user1; Group=gardening; ApplicationName=Accounting;");
    
    foreach (KeyValuePair<String, Object> temp in queryBand)
    {
        Console.WriteLine("Key = {0}, Value = {1}", temp.Key, temp.Value);
    }
}
Requirements

Target Platforms: Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2

See Also

Reference

TdQueryBand Class
TdQueryBand Members