i have three combobox, combobox1 has preloaded list, based on what the combobox1 value will populate the combobox2. i have no errors on this, but when i try to populate combox3, it gives me "child list or field system cannot be created.
this is the code that were higlighted and gives the the error.
ComboBox3.DataSource = table2
ComboBox3.ValueMember = provincetext
ComboBox3.DisplayMember = provincetext
this is what i am trying to do
combobox1(region) <== preloaded list
combobox2(province of selected value of region) <== code runs, no error (populated)
combobox3(municipality/city of selected value of province) <== error, (did not populate)
What I have tried:
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim regiontext As String
regiontext = ComboBox1.Text
Dim connection As New MySqlConnection("datasource=localhost;port=3306;username=root;password=")
Dim adapter As New MySqlDataAdapter("select * from eulat.provinces", connection)
Dim table As New DataTable()
adapter.Fill(table)
ComboBox2.DataSource = table
ComboBox2.ValueMember = regiontext
ComboBox2.DisplayMember = regiontext
End Sub
Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged
Dim provincetext As String
provincetext = ComboBox2.Text
Dim connection2 As New MySqlConnection("datasource=localhost;port=3306;username=root;password=")
Dim adapter2 As New MySqlDataAdapter("select * from eulat.citymun", connection2)
Dim table2 As New DataTable()
adapter2.Fill(table2)
ComboBox3.DataSource = table2
ComboBox3.ValueMember = provincetext
ComboBox3.DisplayMember = provincetext
End Sub