Follow us

Wednesday, December 7, 2011

Cannot implicitly convert type 'System.Linq.IQueryable' to 'System.Collections.Generic.IEnumerable'. An explicit conversion exists (are you missing a cast?)

Scenerio

I was trying the following LINQ to SQL code.

LINQ to SQL : Error

Error

Cannot implicitly convert type 'System.Linq.IQueryable<AnonymousType#1>' to 'System.Collections.Generic.IEnumerable<Member>'. An explicit conversion exists (are you missing a cast?)

Solution

I have explicitly created a class MemberBasicInfo containing FirstName, Gender and Email as properties and modified the LINQ to SQL query as shown below & it was working fine.

Cannot implicitly convert type 'System.Linq.IQueryable' to 'System.Collections.Generic.IEnumerable'. An explicit conversion exists (are you missing a cast?)

Hope! this will be helpful to LINQ to SQL learners.


Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

0 comments: on "Cannot implicitly convert type 'System.Linq.IQueryable' to 'System.Collections.Generic.IEnumerable'. An explicit conversion exists (are you missing a cast?)"

Post a Comment