How can we do an order by using LINQ query?

 Posted by ArticlesMaint on 9/29/2009 | Category: LINQ Interview questions | Views: 2965

Order by in LINQ is pretty simple. We just need to insert order by before the ‘Select’ query.

return from clsCustomer ObjCust in objCustomer

orderby ObjCust.City
select ObjCust;

Below figure shows how we have ordered on the city name.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response