I appreciate that this may be a fairly simple question - but I'm having quite a bit of trouble (as a fledgeling ASP.NET developer). I've gained a number of ideas from SO and Google with no luck and I think I'm beginning to over-think this, it seems such a standard scenario that I believe I'm missing something obvious.
I have for example, three standard example tables - note the Many-to-Many relationship.
Students
- student_id
- forename
- surname
Courses
- course_id
- course_name
StudentCourses
- studentcourse_id
- course_id
- student_id
I'd like to display these on my ASP.NET 3.5 Web Application in a way that looks similar to (the last column being a button to allow them to edit the Student information):
Students:
# Name Courses Actions
1 Joe Bloggs Maths, English [Manage]
2 Arthur Sleep English [Manage]
3 Andy Mann Maths, German, French [Manage]
The "courses" column is a list of the courses that the student is currently enrolled upon. This could be empty (not yet enrolled) or contain a list (comma delimited or a standard unordered HTML list, I'm not precious) of their currently enrolled courses. This would not be a massive list as a student can only enrol on a handful of courses at any one time.
I've tried a number of solutions, ranging from asp:Repeater's to my current favourite, the ListView that came with 3.5. I'm using LINQ to SQL as my data layer (in case it's important due to LINQs complicated support for Many-to-Many relationships).