How can i join two table in Linq and display the join to Data GridView?
I'm trying to join two tables and to display the Join result into GridView
in WinForms, but something is going wrong...
it's not giving me Error message or something, Please help!!
my code : var temp = teacherCmbBx.SelectedItem.ToString();
var temp2 = (from c in context.Teachers
where temp == c.FirstName
select c).ToList();
long num = temp2[0].ID;
var teacherGroup = (from t in context.Teachers
join g in context.Groups on t.ID
equals g.TeacherID
where num == t.ID
select t);
teachergrpGridView.DataSource = teacherGroup;
string temp3 =
(string)teachergrpGridView.Rows[rowNum].Cells[0].Value;
No comments:
Post a Comment