Possible duplicate:
How to get a separate ordered list of names from a DataTable using LINQ?
This is my first question. I get a list of different values for the dropdown from my database as follows:
var plocQ = (from m in db.SERVICE_NRS
orderby m.PLOC
select new { PlocID = m.PLOC, value = m.PLOC }).Distinct();
Order seems to have no effect, I have to do this:
var plocQ = (from m in db.SERVICE_NRS
select new { PlocID = m.PLOC, value = m.PLOC }).Distinct();
plocQ = from s in plocQ
orderby s.PlocID
select s;
I am wondering if this is related to LINQ or the database? I am a little new to LINQ and have written too much SQL before. Any ideas?
source
share