Problems with binding a combobox
I got a form where you can enter information in textboxes and i got comboboxes where i want to choose some predefined options.
I binded the textboxes with the information in the database, and i am trying to bind the combobox with the database.
the problem is the combobox is showing information, but not all the options that it should be. It only shows the options that have been used in the call table. Also if you change the combobox to a value that is used in the second row of the table "calls", all the comboboxes changes to a value that is used in the second row, the same happens if you change 1 combobox back.
I think my problem is in the sql query
here is my connection string
Dim objConnectionAsNew SqlConnection("server=.\sqlexpress;uid=;pwd=;Trusted_Connection=yes;database=Helpdesk2")Dim objDataAdapterAsNew SqlDataAdapter( _"SELECT Call_ID, Date_Logged, Date_Closed, Problem_description, Action, Accepted_By, " & _"Categorie_Description, Call_Status_Description, Priority_Description, FirstName " & _"FROM Calls " & _"JOIN Categorie ON Categorie.Categorie_ID = Calls.Categorie_ID " & _"JOIN Call_status ON Call_status.Call_Status_ID = Calls.Call_Status_ID " & _"JOIN Priority ON Priority.Priority_ID = Calls.Priority_ID " & _"JOIN Employees ON Employees.EmployeeID = Calls.EmployeeID " & _"ORDER BY Call_ID", objConnection)Dim objDataSetAs DataSetDim objDataViewAs DataViewAnd this is what i use for the comboboxes
I commented ValueMember out because it errors on it with the following error
"Cannot bind to the new value member.
Parameter name: value"
cboCategorie.DropDownStyle = ComboBoxStyle.DropDownList
.DataSource = objDataSet.Tables(0)
.DisplayMember ="Categorie_Description"
'.ValueMember = "Categorie_ID"'.SelectedIndex = 0EndWithcboPriority.DropDownStyle = ComboBoxStyle.DropDownList
With cboPriority.DataSource = objDataSet.Tables(0)
.DisplayMember =
"Priority_Description"'.ValueMember = "Priority_ID"'.SelectedIndex = "0"EndWithcboCallStatus.DropDownStyle = ComboBoxStyle.DropDownList
With cboCallStatus.DataSource = objDataSet.Tables(0)
.DisplayMember =
"Call_Status_Description"'.ValueMember = "Categorie_ID"'.SelectedIndex = 0Also if i just use this part
"SELECT Catogorie_ID, Catogorie_Description, " & _
"FROM Catogorie " & _
"ORDER BY Catogorie_ID", objConnection)
and just bind the combobox on my form then it is just fine
so i can't get it to work with all the information in my sql query
If anyone could advise me on this

