SolvedPrivate

LINQ Order BY

Posted on 2014-02-27
2
50 Views
Last Modified: 2016-02-10
In my query below, how do I do an order by on my Region Field?

            Dim Query = _
      (From Region In dataset1.Tables(0) _
      Select Region.Field(Of String)("Region")).Distinct().ToList

Open in new window

0
Comment
Question by:lrbrister
2 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
You need an anonymous function:

Dim Query = _
            (From Region In dataset1.Tables(0) _
             Select Region.Field(Of String)("Region")).Distinct().OrderBy(Function (item) item).ToList

Open in new window

0
 

Author Closing Comment

by:lrbrister
Comment Utility
Once again...
Kudos to kaufman!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Visual Studio installation 5 32
Asp/Net Validation date Issue 9 36
Total in textboxes 9 34
Problem to picture file 3 37
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now