LINQ ascending Query Keyword using C# in ASP.Net
The "ascending" contextual keyword in query expressions is used with LINQ orderby clause to specify that the sort order for the returning result sequence must be in increasing order i.e. from smallest to the largest. By default the orderby clause returns the resulting sequence in ascending order because "ascending" is the default keyword for orderby clause and you may omit it in the query expression. Now let's understand the use ascending keyword with the help example.
Example
int[] numbersArray = { 37, 40, 20, 23, 25, 27, 30, 5, 7, 10, 13, 33, 35, 15, 17 };
var numbers = from n in numbersArray
orderby n ascending
select n;
foreach (int number in numbers)
{
Response.Output.Write("{0} ", number);
}
// Output:
// 5 7 10 13 15 17 20 23 25 27 30 33 35 37 40
The above C# LINQ example shows the use of "ascending" contextual keyword with orderby clause to arrange the sort order of results from smallest to largest.
Continue to the next tutorial: LINQ descending Query Keyword using C# in ASP.Net to learn how to specify the sort criteria in a query expression.

* will not be published
* hint: http://www.example.com