Link to home
Start Free TrialLog in
Avatar of kravindra
kravindra

asked on

How to read the resultset from LINQ to IEnumerable

              IEnumerable<FundsReceiptBatchDetails> batchIds =
                   (from frBatchids in lstfrbd select new { frBatchids.FundsReceiptBatchID }).Distinct().ToList() as
                   IEnumerable<FundsReceiptBatchDetails>;

I am getting exception like object reference is not set to instance of the object.
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

There are a few possibilities.  I am confused, though, why you would create a generics List, and thant convert it back to IEnumerable, which is what form it was in before the ToList call.  I prefer to work with List<FundsReceiptBatchDetails> myself.  
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi kravindra; did this work for you?