[RESOLVED] ToList is not a member of "System.Data.EnumerableRowCollection"
Help here I accidentally pull the power cable and my computer shutdown. After re-opening my project all my LINQ queries turned into this kind of error:
Code:
ToList is not a member of "System.Data.EnumerableRowCollection"
How to fix this?
Re: ToList is not a member of "System.Data.EnumerableRowCollection"
Logically, if you want us to help you with a broken LINQ query then you should show us the query.
Re: ToList is not a member of "System.Data.EnumerableRowCollection"
@JM: I think i would not call it broken query, cause it was running fine not until the computer accidentally shutdown, and when re-opening it that error showed up.
Re: ToList is not a member of "System.Data.EnumerableRowCollection"
Either way, unless you show us the code, we are guessing.
Re: ToList is not a member of "System.Data.EnumerableRowCollection"
Alright here's the code :D :
Code:
Dim listItem = (From rowItem In newDatatable.AsEnumerable() _
Select New With {.SIGN_NAME = rowItem.Field(Of String)("SIGN_NAME")}).ToList
Re: ToList is not a member of "System.Data.EnumerableRowCollection"
Your linq statement is returning a different type from mine, it should be returning a EnumerableRowCollection(Of TRow) which has the extension .ToList that you were using, but as your message it is only returning its base class.
Did you recreate the project file or anything? Change any of the Option infer/strict options etc, or maybe even the framework type?
Re: ToList is not a member of "System.Data.EnumerableRowCollection"
newDatatable.AsEnumerable was added in 3.5, so assume you are using that or 4.0? What type is newDatatable declared as?
Re: ToList is not a member of "System.Data.EnumerableRowCollection"
It sounds like maybe you've lost a library reference or, more likely, a namespace import. Try creating a new project in which that code works, then confirm that you're old project has all the same references and imports.
Re: ToList is not a member of "System.Data.EnumerableRowCollection"
@JM: Yeah I found out that I lost some reference and also namespace import thanks to all replies.