Well, that’s it, I must have missed something.
Each LINQ example that I have seen for anonymous VB.NET claim types can do something like this:
Dim Info As EnumerableRowCollection = pDataSet.Tables(0).AsEnumerable
Dim Infos = From a In Info _
Select New With {
.Prop1 = a("Prop1"),
.Prop2 = a("Prop2"),
.Prop3 = a("Prop3") }
Now, when I proceed to iterate through the collection (see the example below), I get the error message "Name x not declared."
For Each x in Infos
...
Next
How VB.NET does not understand that Infos is a collection of anonymous types created by LINQ, and wants me to declare "x" as some type. (Won't this defeat the goal of an anonymous type?) I added links to System.Data.Linq and System.Data.DataSetExtensions to my project. Here is what I import with the class:
Imports System.Linq
Imports System.Linq.Enumerable
Imports System.Linq.Queryable
Imports System.Data.Linq
Any ideas?