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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top