Export (0) Print
Expand All
1 out of 4 rated this helpful - Rate this topic

How to: Sort Data

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

This topic shows how to sort query results. The example returns a collection of Contact objects sorted alphabetically by the first letter of Contact.LastName. The same example is shown using the following Entity Framework query technologies:

The example in this topic is based on the Adventure Works Sales Model. To run the code in this topic, you must have already added the Adventure Works Sales Model to your project and configured your project to use the Entity Framework. For more information, see How to: Use the Entity Data Model Wizard (Entity Framework) or How to: Manually Configure an Entity Framework Project and How to: Manually Define an Entity Data Model (Entity Framework).

Example

The following is the LINQ to Entities example.

The following is the Entity SQL example.

The following is the query builder method example.

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.