My query equijoins the selected attributes of the iea_foreign_course, the iea_foreign_school
and iea_country tables and compares the drop down selection (a country)to this join as a filter.
This data is bound to the gridview control to be displayed under the column names defined in the select paragraph.
I need the gridview to present these rows grouped by country.
using (DataClassesDataContext c = new DataClassesDataContext())
var schools = c.GetTable<iea_foreign_school>();
var courses = c.GetTable<iea_foreign_course>();
var countries = c.GetTable<iea_country>();
var query =
from ct in countries
join s in schools
on ct.country_id equals s.country_id
join co in courses
on s.foreign_school_id equals co.foreign_school_id
where ct.country_name == DropDownList1.SelectedValue
Partner_Number = co.foreign_course_num,
Partner_Title = co.foreign_course_name,
UNF_Course_Number = co.unf_course_num,
UNF_Course_Title = co.unf_course_name,
Status = co.course_status,
Start_End = co.start_end_date,
Language = co.language,
if (query != null)
GridView1.DataSource = query;