I am trying create a SELECT query on a Mysql database to find records that match the search text field.
ie txtSearch.Text ="B" and records in database "Brown" , "Britten" etc
Database "Persons", Table "table" and column "name"
Trying to get this to work.
cursor = Sql.ExecQuery2("SELECT * FROM table WHERE name LIKE ?",Array As String(txtSearch.text))
Your query will not work as you expect.
If you want only the names beginning with 'B' then you should use: cursor = Sql.ExecQuery2("SELECT * FROM table WHERE name LIKE ?",Array As String(txtSearch.text & "%"))
LIKE 'B%' returns all names beginning with B
LIKE '%B%' returns all names containing B
LIKE '%B' returns all names ending with B
You may have a look HERE.