C
Chris
Hi again,
I want to read all the records of a table with 2 fields.
The problem is that some records have null value in the second field.
This code below works when all records have both fields fiilled, but gives
the error:
"Conversion from type 'DBNull' to type 'String' is not valid" when not.
.....
comd = New System.Data.OleDb.OleDbCommand("select name,lok from pc",
oConnection)
dtreader = comd.ExecuteReader
for i=0 to 41
dtreader.Read()
for j=0 to 1
f=dtreader.item(j)
Response.Write(f)
next
Response.Write("<br>")
next
dtreader.Close()
Thanks for hints.
Chris
I want to read all the records of a table with 2 fields.
The problem is that some records have null value in the second field.
This code below works when all records have both fields fiilled, but gives
the error:
"Conversion from type 'DBNull' to type 'String' is not valid" when not.
.....
comd = New System.Data.OleDb.OleDbCommand("select name,lok from pc",
oConnection)
dtreader = comd.ExecuteReader
for i=0 to 41
dtreader.Read()
for j=0 to 1
f=dtreader.item(j)
Response.Write(f)
next
Response.Write("<br>")
next
dtreader.Close()
Thanks for hints.
Chris