>But I found (actually, David replied in my e-mail) that I can use properties of this anonymous type.
>So, looks like I can simply use code like this
>
>
>foreach (var row in resultingQuery)
> {
> DataRow newRow = dtReturn.NewRow();
>
> newRow["resource1"] = row.resource1;
> newRow["fname"] = row.fname;
>
> dtReturn.Rows.Add(newRow);
> }
>
>
>Wondering if this is easier than David's class or not.
That is (according to old ADO.Net book I read) the slowest way to access and you do that in a tight loop across potentially oodles of rows.
Faster to get column index in advance or AFAIR fastest back then to query the column in advance (outside loop) and use that inside the loop.