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.
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
orderby cs.StudentID
select sa);
return query;
Tables in the query:
StudentAttendance: ID, StudentID, Date, Present, Late (Present and Late are boolean)
ClassStudent: ID, ClassID, StudentID
TeacherClass: ID, TeacherID, ClassID
People have recommended various solutions none of which have worked. Please help before I shoot somebody or myself.
Member
18 Points
187 Posts
Where have the Gurus gone. Please help an idiot.
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:
However I need to retrieve a class of students based on the teacher who is logged in:
Tables in the query:
People have recommended various solutions none of which have worked. Please help before I shoot somebody or myself.