I am using the following code for finding the customer name as and when i type in the Combobox.
I want to look for the string anywhere within the name. For eg. i want to find 'Jack' from the names of the customers then it should give me the result matching 'Jack' in the 1st name or middle name or last name. However the names of the customer are stored as a single string only. Suppose i have three names in my database containing the word 'Jack' within the string then it should give me the following resultsCode:Private Sub combobox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.TextChanged If btnact = "S" Then CUSTOMERBindingSource.Filter = "name like '" & ComboBox2.Text & "%'" End If End Sub
1. Jack Brown
2. Michael Jackson
3. Phill Jack Robinson
What changes do i have to make to my code ?




Reply With Quote