score:3

Accepted answer

Linq querys are not lists, so they don't have an index. To iterate over all the items you can use a foreach like so:

For Each hospital In lqHospitalList
    tvHospitalSelect.Nodes.Add(hospital.CustomerName)
Next

If you want to convert the query to a list:

lqHospitalList.ToList

or array:

lqHospitalList.ToArray

Related Articles