troubleshooting Question

populating a combobox

Avatar of Anthony Matovu
Anthony MatovuFlag for Uganda asked on
.NET ProgrammingVisual Basic.NET
7 Comments1 Solution349 ViewsLast Modified:
I have 5 comboboxes where by the items in the second combobox depend on the section in the first one, the third depends on the second, and so on.

Challenge i have is when i make the first selection all the file get populated with the first element

below is the example of the code i use. this is a windows application for

            dadp = New OleDb.OleDbDataAdapter("SELECT * FROM [villageUnit] WHERE ((([country])= '" & cmbcountry.SelectedValue & "'));", db)
            dT = New DataTable : dadp.Fill(dT) : dadp.Dispose()
            vu.DataSource = dT
            vu.DisplayMember = "villageName" : vu.ValueMember = "vid"
            vu.BindingContext = New BindingContext : vu.SelectedIndex = -1
            Me.hhcode.Text = ""
        Catch inv As InvalidCastException

        Catch ex As Exception

Éric Moreau
Senior .Net Consultant
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros