[RESOLVED] Syntax error (missing operator) in query expression 'Surname Arshad'.
Code:
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Dim cmd As New OleDbCommand("SELECT * FROM tblContacts where Surname " & txtSurname.Text & "", con)
dr = cmd.ExecuteReader
If dr.HasRows Then
dr.Read()
txtfirstName.Text = dr("Surname")
End If
End Sub
Re: Syntax error (missing operator) in query expression 'Surname Arshad'.
"SELECT * FROM tblContacts where Surname = '" & txtSurname.Text & "'"
Re: Syntax error (missing operator) in query expression 'Surname Arshad'.
Quote:
Originally Posted by
TysonLPrice
"SELECT * FROM tblContacts where Surname = '" & txtSurname.Text & "'"
Thank you so much:wave:
This was the thread I made: Link But somehow the code got seperated :confused:
Anyway thanks again, All is working fine now and now I know where I went wrong :)