Private Sub txtsearch_KeyUp(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtsearch.TextChanged
Dim sqlsearch As String
Dim com As New SqlCeCommand
sqlsearch = "select * from tbl_philhealth where tmc like '" & txtsearch.Text & "%';"
Using con As SqlCeConnection = New SqlCeConnection("Data Source=" & My.Settings.PATSDB)
Try
With com
con.Open()
com.CommandType = CommandType.Text
com.CommandText = sqlsearch
com.Connection = con
End With
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly, "Error!")
Finally
com.ExecuteNonQuery()
End Try
End Using
End Sub
in datagridview if i search in the textbox i want to see the thing that i put in the textbox..

New Topic/Question
Reply



MultiQuote






|