check the field exist or not ?

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

pKcno = myReader.Item("kcno") <--it will return error when the field
"kcno" doesn't exist

any method to check the field exist or not first , if not exist, I want to
skip the above statement.

Thanks
 
Agnes said:
pKcno = myReader.Item("kcno") <--it will return error when the field
"kcno" doesn't exist

any method to check the field exist or not first , if not exist, I want to
skip the above statement.

Thanks

Check if its nothing before using it.
If myReader.Item("kcno") is Nothing then
'*** the field doesn't exist
else
' do something creative with it
End If
 
Back
Top