Problem getting values from mysql...

  • Thread starter Thread starter wink martindale
  • Start date Start date
W

wink martindale

Hello all,

I am building a vb.net app, using mysql and corelabs connector.
I am having a bit of difficulty with a dbnull error. Here is some
sample code:

Do While myReader3.Read()
txtFname.Text = myReader3("fname")
txtLname.Text = myReader3("lname")
txtMiddle.Text = myReader3("middle")
txtAddress.Text = myReader3("address")
txtAddress2.Text = myReader3("address2")
txtCity.Text = myReader4("citycode") <- Error starts here
txtState.Text = myReader4("state_code")
txtHphone.Text = myReader4("hphone")
txtWkphone.Text = myReader4("wkphone")
txtCell.Text = myReader4("cellphone")
Loop

The problem is, I get a dbnull error at "citycode". In order to pull
the rest of the data (there are 26 fields I am trying to extract), I
have to open a new connection, get the next 6 values, close, reopen
and get the next 6 values. NONE of the fields are null!
Does anyone have any idea why this would occur??? I am totally
stumped!

TIA,

Daniel
 

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