anand P

anand P

  • NA
  • 7
  • 7.8k

How to Get value from ienumerable list?

Aug 24 2012 1:26 AM

Hi,

I tried

var maxId = HouseList.Max(h => h.HouseId);

but i get error as

Sequence contains no elements

But I had loaded element into list as

 public void LoadHouse()
       
{
            _stx
= new CPMDomainContext();
           
LoadOperation<House> lo = _stx.Load(_stx.GetHousesQuery());
           
HouseList = lo.Entities;
       
}

I use HouseList as ItemSource for a combobox..It binds data..But while i check HouseList.count always zero.How can i get elements from HouseList.Help me..


Answers (6)