error: "No data exists for the row/column"

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi,

I want to show the whole recordset. There are 42 records and 2 fields.
....
comd = New System.Data.OleDb.OleDbCommand("select name,lok from pc",
oConnection)
dtreader = comd.ExecuteReader
for i=0 to 41
for j=0 to 1
dtreader.Read()
f=dtreader.item(j)
Response.Write(f)
next
Response.Write("<br>")
next
....

I get the error: "No data exists for the row/column"
I didn't defined any table, so why row/column error?
Thanks
 
You have 42 rows, but you are attempting to read it 84 times. You have a
loop within a loop. Perhaps you want your Read() outside of the inner loop

Jeff
 
Of course, thanks a lot.


Jeff Dillon said:
You have 42 rows, but you are attempting to read it 84 times. You have a
loop within a loop. Perhaps you want your Read() outside of the inner loop

Jeff
 
Back
Top