dotConnect for SQL Server Documentation
Devart.Common Namespace / SelectColumnCollection Class
Members Example

In This Topic
    SelectColumnCollection Class
    In This Topic
    Represents a collection of columns and expressions in a SelectStatement object.
    Syntax
    'Declaration
     
    Public NotInheritable Class SelectColumnCollection 
       Inherits System.Collections.CollectionBase
       Implements System.Collections.ICollectionSystem.Collections.IEnumerableSystem.Collections.IList 
    Remarks
    Use SelectColumnCollection class to manage columns used in a query. To access the collection use the SelectStatement.Columns, SelectStatement.GroupBy and SelectStatement.OrderBy properties.
    Example

    In the following sample we retrieve a collection of SelectColumns from an SqlSelectStatement object and print them. For example, if statement represents the command:

    SELECT test.dept.dname Department, test.dept.loc Location
        FROM test.dept
    

    the output of the sample would be the following:

    test.dept.dname Department
    test.dept.loc Location
    
    SelectColumnCollection collection = statement.Columns;
    
    foreach (SelectColumn column in collection)         
            Console.WriteLine(column.ToString());
    Dim collection As SelectColumnCollection = statement.Columns
    For Each column In collection
            Console.WriteLine(column.ToString())
    Next
    Inheritance Hierarchy

    System.Object
       System.Collections.CollectionBase
          Devart.Common.SelectColumnCollection

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also