Click here to Skip to main content
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 OriginalGriff 406
1 /\jmot 180
2 Suraj Sahoo | Coding Passion 170
3 Afzaal Ahmad Zeeshan 159
4 BillWoodruff 154
0 OriginalGriff 8,344
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,634
3 Maciej Los 5,024
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2014
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