I want to be able to execute the following query:
select distinct studentname, subject, grade from studenttable;
The student table has the following fields:
studentid
studentname
subject
grade
The linq query I have now is:
var students=dc.Select(s => new {s.studentname, s.subject, s.grade}).Distinct();
dc is the data context.
This query works, but how do I get the student id
while still satisfying the distinct condition on the studentname, subject, grade
set?