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
ProductVersionsPlatforms
.NET6, 7Windows, Linux, MacOS
.NET Framework4.6.2, 4.7, 4.7.1, 4.7.2, 4.8Windows
.NET Standard2.0Windows, Linux, MacOS
See Also

Reference

TdQueryBand Class
TdQueryBand Members