©2009 Microsoft Corporation. All rights reserved.
C# Language Reference
ascending (C# Reference)

Updated: July 2008

The ascending contextual keyword is used in the orderby clause [ http://msdn.microsoft.com/en-us/library/bb383982.aspx ] in query expressions to specify that the sort order is from smallest to largest. Because ascending is the default sort order, you do not have to specify it.

The following example shows the use of ascending in an orderby clause [ http://msdn.microsoft.com/en-us/library/bb383982.aspx ] .

C#
IEnumerable<string> sortAscendingQuery =
    from vegetable in vegetables
    orderby vegetable ascending
    select vegetable;

Concepts

LINQ Query Expressions (C# Programming Guide) [ http://msdn.microsoft.com/en-us/library/bb397676.aspx ]

Reference

descending (C# Reference) [ http://msdn.microsoft.com/en-us/library/cc713622.aspx ]

Other Resources

C# Reference [ http://msdn.microsoft.com/en-us/library/618ayhy6.aspx ]

Date

History

Reason

July 2008

Added topic.

Information enhancement.

Tags: 
 
Community Content