I am just a beginner in databasing and after I used this, it only shows msgbox that says unknown command.
Try
connectionDB.Open()
cmdDB.CommandText = "SELECT * FROM rescuers WHERE LastName='" & searchres.Text & "';"
readDB = cmdDB.ExecuteReader()
With readDB
.Read()
rescid.Text = .Item("RescuerID")
lname.Text = .Item("LastName")
fname.Text = .Item("FirstName")
.Close()
End With
2
Answers
Try setting up the sqlcommand and sqldatareader like so :
Post your code for setting up the SqlConnection as well.
Try the following, using parameters to avoid SQL injection
this is assuming that you have already defined your reader like this: