Hi,
I'm trying to create a Select Distinct query, but i'm getting stuck with either an empy combobox either a filled combobox that displays all the doubles.
I have a form (form5) with 1 combobox and 1 datagrid.
The datagrid loads 5 collumns "ID", "firm", "Fname", "mname", "Lname"
The collumn "firm" will have some double firms with people in the other collumns
ID Firm Fname Mname Lname
1 AA John N West
2 AA Jim L East
3 BB Harry Sick Long
4 CC Barry N Klote
etc.
I would like to select the firm from a combobox and filter the datagrid so that it only displays the selected firm and the people that are registred here. Furthermore i want the combobox that i use for selecting the firms to lose the doubles.
I can load the datagrid and load the Combobox, but selecting is only pointing to the record (highlights in the grid) i choose and doesn't filter. Is there anyone that can give me a clue on how to solve this.
Private Sub Form5_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.EmployeesTableAdapter.Fill(Me.passer2012DataSet.Employees)
End Sub
Dim ds As New passer2012DataSet
Dim con As New OleDb.OleDbConnection
Dim da As New OleDb.OleDbDataAdapter("Select DISTINCT firm from Employees", con)
Dim dt As New DataTable
cmbfirma.DataSource = ds
cmbfirma.DisplayMember = "employeeID"
cmbfirma.ValueMember = "Firma"
Me.EmployeesTableAdapter.Fill(Me.Kjelpasser2012DataSet.Employees)
con.Close()
Thank you for your reply. I don't seem to get i to work this way.
I use the "Me.EmployeesTableAdapter.Fill" method so is it possible that i don't need to use the OLEDB connection or do i still need this to correctly connect to the DB (access)? I changed a bit in the script you had sent but this did not do the trick. Any tips?
The combobox fills with the following text.
System.Data.DataViewManagerListItemTypeDescriptor
what to do about this message?