This query returns an anonymous object -
Dim Query = _
From PC In dtName.AsEnumerable() _
Where PC.Field(Of String)("PC_Name") = strPC _
Select New With _
{ _
.PCID = PC.Field(Of Long)("PCID"), _
.PCName = PC.Field(Of String)("PC_Name") _
}
Thus you cannot directly convert it to
PC
in
For Each PC In Query
For Each PC In Query
Debug.Print("PCID: " & PC.PCID)
Debug.Print("PC Name: " & PC.PCName)
lngPCID = PC.PCID
Next