This is my search button and textbox code, but i will got error on pelanggandatagridview and searchdatas, i need to search data on SQL DB like google! just type any word with almost same with the data and it will show on pelanggandatagridview, please help me...
Private Sub Button5_Click(ByVal searchword As String)
Dim strsql As String
strsql = "select * from pelanggan where name like '" & searchword & "%'"
Dim sqlcmd As New SqlClient.SqlCommand
Dim SQLConn As New SqlClient.SqlConnection()
Dim sqlda As New SqlClient.SqlDataAdapter
Dim sqldr As SqlClient.SqlDataReader
sqlcmd.commandtext = strsql
sqlcmd.connection = sqlconn
sqlda.selectcommand = sqlcmd
sqldr = sqlcmd.executereader()
PelangganDataGridView.Item.clear()
While (sqldr.read())
With PelangganDataGridView.Item.add(sqldr("Ic"))
.subitems.add(sqldr("Nama"))
.subitems.add(sqldr("Hand"))
.subitems.add(sqldr("Home"))
End With
End While
sqldr.close()
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
searchdatas(TextBox2.Text)
End Sub
End Class