i have one table containing 2 columns namely Designation and Department.
i want from choosing on DeptnameCB the DesEmpCB will display the corressponding designation to the department chosen.

i have this code as of now.

 Dim strsql = "select * from DesignationEveryDepartment where Department = '" & DeptNameCB.Text & "'"
        Dim acscmd As New OleDb.OleDbCommand
        acscmd.CommandText = strsql
        acscmd.Connection = asconn
        acsdr = acscmd.ExecuteReader()

        While (acsdr.Read())
            DesEmpCB.Text = (acsdr("Designation"))
        End While

please help me. :)

Recommended Answers

All 2 Replies

I will try telling you one approch for this. When you load the combo 1 and after selection in combo 1, get all the data for combo2 in dataset and filter using dataview.rowfilter method and bind the selected record to ur combo..

how should the codes look like. ?
should i place the code on the combo1?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.