2013-07-02 5 views
0

Я пытаюсь связать древовидное представление динамически.System.Collections.Generic.List <ActualEstimatation.frmEstimate.ItemInfo> 'не содержит определения для' Where '

Я искал в Google и нашел хорошие ссылки.

Когда я пытаюсь запустить в моей системе его показывая что-то ошибки, как этот

'System.Collections.Generic.List<ActualEstimatation.frmEstimate.ItemInfo>' does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type 'System.Collections.Generic.List<ActualEstimatation.frmEstimate.ItemInfo>' could be found (are you missing a using directive or an assembly reference?) 

Эти ссылки How to dynamically populate treeview (C#)

и решения sga101 в How to insert Datas to the Winform TreeView(C#) in effitive coding?

Я искал в Google, чтобы решить выше, но не найдено никакого решения.

Пожалуйста, помогите мне решить эту проблему.

Заранее спасибо

+0

вы с помощью платформы .NET 3.5 или выше? –

+0

да, я использую .net Framework3.5 – user1926138

+0

Enumerable.Where() - метод расширения *. Поместите 'using System.Linq;' в верхней части файла исходного кода. –

ответ

0

мне нужно видеть больше кода, но я считаю, что вам не хватает является LINQ заявление. here вы можете прочитать об этом и начать видеть, как реализовать в своем приложении.

, например:

using (ServiceContext svcContext = new ServiceContext(_serviceProxy)) 
{ 
    var query_where1 = from a in svcContext.AccountSet 
       where a.Name.Contains("Contoso") 
       select a; 
    foreach (var a in query_where1) 
    { 
    System.Console.WriteLine(a.Name + " " + a.Address1_City); 
    } 
} 
Смежные вопросы