iam using vb 2010 and i want to search for any record when i enter a text in the search text box. i mean, if my records are as follows:
dan,daniel,edn,steven,mary.
and i just inpunt 'd' in the search box, the datagrid lists: dan,daniel,edn because they have a 'd' in them.
my code is as follows.
Sub search()
Dim objConn As New MySqlConnection
Dim objCmd As New MySqlCommand
Dim strConnString,strSQL As String
strConnString = "Server=localhost;User Id=root; Password=root; Database=mydatabase; Pooling=false"
strSQL = "SELECT * FROM donationtype WHERE firstName like '%" & strKeyWord &"'"
objConn.ConnectionString = strConnString
With objCmd
.Connection = objConn
.CommandText = strSQL
.CommandType = CommandType.Text
End With
End Sub