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
No comments:
Post a Comment