I'm still trying to figure out how to get selectedindex of combobox1 to retrieve only certain information from SQL. I still think it's easier for me to just do
Select Column From Table Where (certain row item)
but for some reason this doesn't work. WHY Am I missing something I understand the statement, but I don't know how to get it to work. You know how the program automatically detects the language and highlights it in blue, well it doesn't do that for "From" and "Where". WHY If someone can answer that, I'd appreciate it.
So anyways, I took a different route and now I get the message
"Argument Exception was Unhandled: Cannot bind to the property 'Food Components' on the target control.
Parameter name: PropertyName"
Here's the code I used (highlighted code is where I get error):
Private Sub Food_ComponentsComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Food_ComponentsComboBox.SelectedIndexChanged With Me.Food_ComponentsComboBox"Milk").Items.Add(
.Items.Add(
"Fruits/Vegetables").Items.Add(
"Meats").Items.Add(
"Grains/Breads") End WithIf Food_ComponentsComboBox.SelectedItem = "Milk" Then
With Me.Food_Item_as_PurchasedComboBox
Me.USDADatabaseDataSet.USDA.Items.Clear()
.DataSource =
.DataBindings.Add(
"Food Components", Me.USDADatabaseDataSet.USDA.Columns, "Milk", True).DisplayMember =
"Food Item as Purchased".ValueMember =
"Food Components" End With End If End Sub
Sorry for being so dumb at this, and any help is greatly appreciated.