hey guys i need some help on my Search button
It seems that it is not accepting the data on the cboSI.text which contains the Field Names of the Table
Heres the Code:
Private Sub cmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
Try
Dim d3 As New MySqlDataAdapter("select * from tblbooks where '" & cboSI.Text = "ISBN" Or "Title" Or "Author" Or "Publisher" Or "Category" & "' like '" & txtSF.Text & "'", connstr)
Dim d4 As New DataTable
d3.Fill(d4)
dgvBooks.DataSource = d4
Catch ex As Exception
MsgBox(Err.Description)
End Try
End Sub
But if i tried to Directly put the field name
Dim d3 As New MySqlDataAdapter("select * from tblbooks where ISBN like '" & txtSF.Text & "'", connstr)
It works but only for ISBN cause its the only field name that i put there
aslo i wanted to change it output to Highlighting the Data in the DataGridVie instead of just showing the specific search cause that is for Sorting the Field Name's Data