Object reference not set to an instance of an object.

J

John

Hi

I am getting an 'System.NullReferenceException: Object reference not set to
an instance of an object.' error on the following line;

Dim sSQL As String = "INSERT INTO applications ( title, forenames, surname,
occupation) " & _ '<== This line gives the error.
"VALUES('" & txtTitle.Text & "', '" &
txtForenames.Text & "', '" & txtSurname.Text & "', '" &
txtOccupation.SelectedItem.Text & "')"

What am I doing wrong?

Thanks

Regards
 
G

Guest

hi john,
The line of code that you gave below might not throw this exception. If you
can paste a few lines below and after it would be much clear.
the best
srini
 

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

Top