可能重复:
DISTINCT() 和 ORDERBY 问题
listOrders.DataSource = (from sp in dbdata.Specifications.Where(i => i.Approve == "Yes" && i.Awailable_BOM == "Yes")
join ord in dbdata.Orders on sp.O_id equals ord.O_id
join prd in dbdata.Products.Where(k => k.Hours_prd == null) on ord.O_id equals prd.O_ID
orderby ord.Special, sp.Due_date
select ord.O_id).Distinct();
我想按“ord.Special, sp.Due_date”订购,但在我输入“Distinct();”后它不起作用。那么如何按“ord.Special, sp.Due_date”排序并获得不同的值。