I am working with an Entity that is laid out like the following:
User -> UserFacilities -> Facilities
The User has a collection of facilities that (s)he can be assigned to. The UserFacilities entity is just a bridge entity that links distinct users to distinct facilities (M:N relationship). I am trying to bind the list of facilities that a user is assigned to into a Listbox on an ASP.NET 1.1 page and have had little success so far.
Here's the code i am using for the databinding.
lboUserFacilities.DataSource = _user.UserFacility;
lboUserFacilities.DataTextField = "_user.UserFacility.Facilities.Description";
lboUserFacilities.DataValueField="_user.UserFacility.FacilityId";
FacilityID is the primary key value that is being shared between the Facilities and the UserFacility table. Description is the text description of a given facility. I will be adding users to facilities by adding facilities to the FacilityCollection of a given user, but just need to get the databinding for this worked out. All the samples i have seen so far have to do with Windows Forms.
Thanks,
Rob