hello everyone
can anyone help on this.
i have a table with column's (itemcode, itemname, price) on the vb form i have one search field (textbox1) and datagrid
i have data as
itemcode itemname price
1234 apple 10
1235 orange 12
1345 grapes 15
1356 banana 15
1357 apricot 25
2345 strawberry 20
2346 guava 10
now what i am trying is if i type 1 then grid show all data's starting with 1 and as i type 12 then it should filter only remaining data with itemcode starting with 12... and so on.\
i hope i am able to get my point through..
simple search i am able to i.e. when whole string match's with itemcode it shows the details in gridview.
code i m using on change event of textbox is
thanx in advanceCode:Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged 'i have opened connection above cn.Open() Dim a As New OleDbDataAdapter("Select * from Item where ItemName = ' " & TextBox1.Text & "'", cn) Dim b As New DataSet a.Fill(b, "Item") DataGridView2.DataSource = b.Tables(0) cn.Close() End Sub
![]()


Reply With Quote

