Click here to Skip to main content
11,484,402 members (66,355 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET MVC
Cannot implicitly convert type 'System.Collections.Generic.List' to 'System.Collections.Generic.IEnumerable'. An explicit conversion exists (are you missing a cast?)

any one tell me that whats type that error and whats that solution..please help me ..quickly..?
Posted 23-Jan-13 22:24pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This is exactly what it is. You need a cast: http://msdn.microsoft.com/en-us/library/ms173105.aspx[^].

However, it's much more likely that you had to avoid cast, always a good idea, but failed due to wrong design of the code. As you show no code, we cannot help you more.

—SA
  Permalink  
Comments
babarjan at 24-Jan-13 4:12am
   
sir basicalli ian facing that error...can u guide me please..


"Error 37 Cannot implicitly convert type 'System.Collections.Generic.List' to 'System.Collections.Generic.IEnumerable'. An explicit conversion exists (are you missing a cast?) C:\Documents and Settings\JavedAhmed\My Documents\Visual Studio 2010\Projects\SFM\SFM\Controllers\EmployeeHistoryController.cs 93 35 SFM"

please solve that error...
Sergey Alexandrovich Kryukov at 24-Jan-13 12:37pm
   
There is no such thing as "solve this error". Solve based on what?!

Look at your code. Learn about assignability of variable/members of classes and interfaces taking into account inheritance.

Here is what I think: your question, especially this follow-up one, shows that you should not really "solve this". You really, really need to abandon the project for a while and learn the very elementary basics of programming. For now, you don't even have a clue how to ask a question, what to show, etc. Do something way simpler, before you gain confidence. Honestly, even it you get help, you won't be able to program.

—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

try to adding .ToList(); and end.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

You can Use .toArray().


System.Collections.Generic.List<int> list = new System.Collections.Generic.List<int>( );
list.Add( 1 );
System.Collections.Generic.IEnumerable<int> enumer = list.ToArray( );
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 190
1 Sergey Alexandrovich Kryukov 170
2 Raje_ 155
3 OriginalGriff 147
4 Mehdi Gholam 120
0 Sergey Alexandrovich Kryukov 8,484
1 OriginalGriff 7,948
2 Sascha Lefèvre 3,189
3 Maciej Los 2,601
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100