I’m doing a bit of code that pulls through rows from a database connection and should return a linenumber for each row. I’m doing this in the following way.
linenum = 0
Do While (rsData.Read())
linenum = linenum + 1
Now when I ouput a DB connection with 8 rows, the linenumbers for each of the rows return as 1222222.
I need to determine the correct numbers so I can do the following to change row styles.
If ((linenum / 2) = Int(linenum / 2)) Then
html += Chr(13) & "<tr class=""openrow2"">"
Else
html += Chr(13) & "<tr class=""openrow1"">"
End If
Any ideas why my rows past the first one seem to only get referred to as linenumber 2 rather than the next number in the series?
Thanks!
Just a shoot in the dark, but where is your loop statement ?
Also if linenum is an integer why don’t use the MOD operator ?