This HasRows property isn't in all versions of .net. Why not recast your code like this?
boolean firstRow = true;
while (rdr.Read())
{
if (firstRow) { // get the column names, but only once
firstRow = false;
for (int hi = 0; hi < fields; hi++)
{
string val = rdr.GetName(hi);
headers[hi] += val;
fmaxl[hi] = val.Length;
}
}
... //process each row.
}
Having done tonnage of this kind of stuff, I know this works pretty well.