tags:

views:

144

answers:

1

Using Linq to SQL:

if(!parentlist.childlist.Contains(row1))
      parentlist.childlist.Add(row1);
else

How do I update the required childlist row with row1? Each row of the child list has a unique id.

parentlist implements IEnumerable and childlist is IList.

A: 

I don't think you can do it this way. You need to select the chidlist item out of the datacontaxt and then add the row to it and submit back.

Its not satisfactory really, but i think its just one of the annoying limitations of linq2sql.

John Nicholas