AutoCompleteStringCollection for single column but need multi column information

  • Thread starter Thread starter muhammadanzar
  • Start date Start date
M

muhammadanzar

Guest
code work fine for one column, but now requirement are

we need to show product name other column like qty,stock,price,active stock etc. in data grid view or list view in dropdown list when ever type a character like

but this code show only product name.

Dim qry1 As String = "SELECT * FROM Table1"
Dim qry2 As String = "product"

Dim connection1 As New SqlConnection("Data Source=.\SQLExpress;Initial Catalog=home;Integrated Security=True")
Dim command1 As New SqlCommand(qry1, connection1)
Dim table1 As New DataTable
Dim adapter1 As New SqlDataAdapter(command1)
Dim col As New AutoCompleteStringCollection
adapter1.Fill(table1)
For a = 0 To table1.Rows.Count - 1
col.Add(table1.Rows(a)(qry2).ToString())

Next

TextBox7.AutoCompleteSource = AutoCompleteSource.CustomSource
TextBox7.AutoCompleteCustomSource = col
TextBox7.AutoCompleteMode = AutoCompleteMode.SuggestAppend

'-------------------------------------------------------------

now when i type textbox7 it show all information about product in list view or grid view drop down list like product name,product code,product price , product qty , product stock etc

Continue reading...
 
Back
Top