We help IT Professionals succeed at work.

How to read the resultset from LINQ to IEnumerable

kravindra
kravindra asked
on
407 Views
Last Modified: 2013-11-11
              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.
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
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.  
Retired
CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Fernando SotoRetired
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
Hi kravindra; did this work for you?
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.