6
Reply

How to Get value from ienumerable list?

anand P

anand P

Aug 24 2012 1:26 AM
5.2k

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)
Next Recommended Forum