orderby clause

The orderby statement sorts the sequence in ascending or descending order. The default sort order is ascending. Additional sorting is possible with several keys. orderby clause is defined as
orderby-clause ::= orderby (keyExpr (ascending | descending)?)*
Example
MySqlConnection conn = new MySqlConnection("SERVER=localhost; DATABASE=employees;UID=root;PASSWORD=");
var emp = new EmployeeDataContext(conn);

var results = from e in emp.Employees
                orderby e.LastName, e.FirstName descending, e.BirthDate ascending
                select new { e.LastName, e.FirstName, e.BirthDate};

foreach (object b in results.Take(10))
    Console.WriteLine(b);

Listing 9.

The output is Listing9

No comments:

Asterisk AST_SORCERY function

 AST_SORCERY gets a field from a sorcery object. Sorcery is always created for PJSIP aors, endpoints and identifies in asterisk. It allows y...