Jun 11, 2013 05:09 AM|mr41971|LINK
First of all please point me to a good resource for learning LINQ to SQL. All I want to do is have the student's name show in the gridview instead of the ID. This part of a Entity Framework Dynamic Data Project.
This code returns the student's name:
return this.ObjectContext.StudentAttendances.Include("Student").OrderBy(s => s.Student);
However I need to retrieve a class of students based on the teacher who is logged in:
var query = (from sa in this.ObjectContext.StudentAttendances.Include("Student")
join cs in this.ObjectContext.ClassStudents.Include("Student")
on sa.StudentID equals cs.StudentID
join tc in this.ObjectContext.TeacherClasses
on cs.ClassID equals tc.ClassID
where cs.ClassID == ClID
Tables in the query:
People have recommended various solutions none of which have worked. Please help before I shoot somebody or myself.