Linqは初めてですが、VBでのorder byの構文は何ですか?
Dim cxt As New datContext
Dim qry = (From lst In cxt.zipcodes _
Select lst.state).Distinct
qry = qry.OrderBy()
私の単純なSQLステートメントは次のようになります。
Select distinct state from zipcodes
order by State
qry = qry.OrderBy(Function(obj) obj.PropertyToSortBy)
クエリの代替構文(よりクリーンなIMO):
Dim qry = From lst In cxt.zipcodes _
Select lst.state Distinct _
Order By state
Dim cxt As New datContext
Dim qry = (From lst In cxt.zipcodes OrderBy lst.state).Distinct.tolist
Dim statelst = qry.Select(Function(o) o.state).ToList