Need C# snippet help - List difference

nitin2003

Client
Регистрация
18.09.2012
Сообщения
195
Благодарностей
11
Баллы
18
Hi,

I am trying to find the difference between 2 lists and add the difference into 3rd list.

I wrote this 1 liner c# snippet :
Код:
project.Lists["List3"] = project.Lists["List2"].Except(project.Lists["List1"]).ToList();
But this is throwing an exception.

"Property or indexer 'ZennoLab.InterfacesLibrary.ProjectModel.Collections.ILists.this[string]' cannot be assigned to -- it is read only". [Row: 1; Column: 1]"

It is not letting me write to the List3. How can I make it save the difference in third list? Can someone please help?

Thanks
Nitin
 
Последнее редактирование:

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
  • Спасибо
Реакции: nitin2003

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)