|
-
May 27th, 2011, 01:07 AM
#1
Thread Starter
Fanatic Member
[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?
-
May 27th, 2011, 02:03 AM
#2
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.
-
May 27th, 2011, 03:47 AM
#3
Thread Starter
Fanatic Member
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.
-
May 27th, 2011, 04:04 AM
#4
Re: ToList is not a member of "System.Data.EnumerableRowCollection"
Either way, unless you show us the code, we are guessing.
-
May 27th, 2011, 04:14 AM
#5
Thread Starter
Fanatic Member
Re: ToList is not a member of "System.Data.EnumerableRowCollection"
Alright here's the code :
Code:
Dim listItem = (From rowItem In newDatatable.AsEnumerable() _
Select New With {.SIGN_NAME = rowItem.Field(Of String)("SIGN_NAME")}).ToList
-
May 27th, 2011, 05:50 AM
#6
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?
-
May 27th, 2011, 05:56 AM
#7
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?
-
May 27th, 2011, 06:17 AM
#8
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.
-
May 29th, 2011, 11:58 PM
#9
Thread Starter
Fanatic Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|