so i have a combox that will tell you that which data will appear like "name", "contacts","website","email" and data will appear in gridview but i want to filter the data in gridview
example
in name
if you type
a
all data starting with a will appear and everything starts with b-z will disappear
and ab
all with data with ab will appear and the rest will disappear
in contacts
same as a if i type 0 it will appear and everyhing starts with 1-9 dissappear
here the code for combobox
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedItem.ToString() = "Name" Then
' Dim connection As New OleDbConnection(connectionString)
' Dim sql As String = "SELECT personalname,contactnumero FROM save "
' Dim dataadapter As New OleDbDataAdapter(sql, connection)
' Dim ds As New DataSet
'connection.Open()
'dataadapter.Fill(ds, "save")
'connection.Close()
'bsData.DataSource = ds
'bs = New BindingSource
' bs.DataSource = ds
'DataGridView1.DataMember = "save"
'DataGridView1.ReadOnly = False
'Bind the DataTable to the BindingSource
'DataGridView1.DataSource = bsData
'Dim dt As DataTable = New DataTable
'Add the PartNumber column
'Create a new BindingSource
'Bind the BindingSource to the DataGridView
ElseIf ComboBox1.SelectedItem.ToString() = "ContactNumber" Then
Dim connection As New OleDbConnection(connectionString)
Dim sq3 As String = "SELECT contactnumero,personalname FROM save "
Dim dataadapter As New OleDbDataAdapter(sq3, connection)
Dim ds1 As New DataSet
connection.Open()
dataadapter.Fill(ds1, "save")
connection.Close()
DataGridView1.DataSource = ds1
DataGridView1.DataMember = "save"
DataGridView1.ReadOnly = False
ElseIf ComboBox1.SelectedItem.ToString() = "Email" Then
Dim connection As New OleDbConnection(connectionString)
Dim sq3 As String = "SELECT emailadds FROM save "
Dim dataadapter As New OleDbDataAdapter(sq3, connection)
Dim ds1 As New DataSet
connection.Open()
dataadapter.Fill(ds1, "save")
connection.Close()
DataGridView1.DataSource = ds1
DataGridView1.DataMember = "save"
DataGridView1.ReadOnly = False
'emailadds
End If
End Sub
no code for textbox