Well, the error message is pretty obvious:
foreach
operates with collections, namely with objects whose classes implement the
IEnumerable
interface. If
results
is an integer variable (you didn't show its declaration in the posted code) then it doesn't and cannot be used in such a way.
Assuming
results
contains the number of found items, then you might iterate using a standard
for
loop, e.g.
for (int r = 0; r < results; ++r)
{
}