dotConnect for MySQL Documentation
Devart.Common Namespace / SelectStatement Class / OrderBy Property
Example

In This Topic
    OrderBy Property
    In This Topic
    Contains list of columns used in the ORDER BY clause of the current SelectStatement object.
    Syntax
    'Declaration
     
    Public ReadOnly Property OrderBy As SelectColumnCollection
    public SelectColumnCollection OrderBy {get;}

    Property Value

    A SelectColumnCollection that represents list of columns used in the ORDER BY clause.
    Example
    The following example demonstrates how to use the OrderBy property.
    MySqlSelectStatement stmt = new MySqlSelectStatement();
    SelectColumn empName = new SelectColumn("ENAME");
    stmt.Columns.Add(empName);
    stmt.Tables.Add(new SelectTable("emp"));
    
    stmt.OrderBy.Add(empName);
    
    //select ENAME from emp order by ENAME
    MySqlCommand command = new MySqlCommand(stmt.ToString());
    Dim stmt As New MySqlSelectStatement
    Dim empName As New SelectColumn("ENAME")
    stmt.Columns.Add(empName)
    stmt.Tables.Add(New SelectTable("emp"))
    
    stmt.OrderBy.Add(empName)
    
    'select ENAME from emp order by ENAME
    Dim command5 As New MySqlCommand(stmt.ToString)
    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