General information
Title:
Many-to-Many using DataRelations
Has everybody done a many-to-many relation using the DataRelation object? I need to track meeting attendance and have 3 tables: members, attendance, and meetings. The attendance table is the many-to-many.
I have set up the DataRelations below to allow using multiple grids in a WinForm. The grids are read-only (coming from an XML file) and I would prefer to keep DataRelations instead of creating new temp tables via joins. The problem I have is only the first record in the meetings is displayed.
_ds.Relations.Add("Members2Attendance", _ds.Members.IDColumn,
_ds.Attendance.Member_FKColumn);
_ds.Relations.Add("Attendance2Meetings", _ds.Attendance.Meeting_FKColumn,
_ds.Meetings.IDColumn, false);
dgMembers.SetDataBinding(_ds, "Members");
dgMeetings.SetDataBinding(_ds,
"Members.Members2Attendance.Attendance2Meetings")
Does anybody have a clue what I am doing wrong?
John
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only