Hi, I was looking for some help with the following situation.
I have 3 tables User, UserGroup, and Group. User contains user information, Group contains group information and UserGroup is a mapping to allow a many to many relationship between User and Group.
I am encountering a problem when I create a new User and then try and add some groups to the user.
I create the UserEntity object and then assign some values to its properties, which all goes according to plan.
When I try and add 1 or more groups as selected from a ListBox I get an
// UserEntity _user = new UserEntity() - define earlier in code
foreach (GroupEntity aGroup in groupsList.SelectedItems)
{
Console.WriteLine(aGroup.Name.ToString());
_user.Group.Add(aGroup);
}
At the line [b]"_user.Group.Add(aGroup);[/b]" I get the following error
**"An unhandled exception of type 'System.InvalidOperationException' occurred in sd.llblgen.pro.ormsupportclasses.net11.dll
Additional information: This collection is read-only."**
I am probably attacking this problem wrongly so any advice would be appreciated
Thanks
Andy