0

The Three lists need to show Three things Respectively Activity, Sub_Activity and Mentor For the Activity. Please any Help Will be Appreciated.

Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
        Dim con As New SqlConnection("Data Source=GOD-C9522C081F1;Initial Catalog=Project;Integrated Security=True")
        con.Open()
        Dim str As String = ""
        Dim dr As SqlDataReader
        Dim li As ListItem
        str = ("select distinct Activity from competency ")
        Dim com As New SqlCommand(str, con)
        dr = com.ExecuteReader()
        While dr.Read
            li = New ListItem(dr("Activity"))
            DropDownList1.Items.Add(li)
        End While
        dr.Close()
    End Sub


    Protected Sub DropDownList2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList2.SelectedIndexChanged
        Dim con As New SqlConnection("Data Source=GOD-C9522C081F1;Initial Catalog=Project;Integrated Security=True")
        con.Open()
        Dim str As String = ""
        Dim dr As SqlDataReader
        Dim li As ListItem
        str = ("select distinct Sub_Activity from competency where Activity = '" + DropDownList1.SelectedItem.Value + "'")
        Dim com As New SqlCommand(str, con)
        dr = com.ExecuteReader()
        While dr.Read
            li = New ListItem(dr("Sub_Activity"))
            DropDownList1.Items.Add(li)
        End While
        dr.Close()
    End Sub

    Protected Sub DropDownList3_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList3.SelectedIndexChanged
        Dim con As New SqlConnection("Data Source=GOD-C9522C081F1;Initial Catalog=Project;Integrated Security=True")
        con.Open()
        Dim str As String = ""
        Dim dr As SqlDataReader
        Dim li As ListItem
        str = ("select distinct Mentor from competency where Sub_Activity = '" + DropDownList2.SelectedItem.Value + "'")
        Dim com As New SqlCommand(str, con)
        dr = com.ExecuteReader()
        While dr.Read
            li = New ListItem(dr("Mentor"))
            DropDownList1.Items.Add(li)
        End While
        dr.Close()
    End Sub

Edited by Ezzaral: Added [code] [/code] tags. Please use them to format any code that you post.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by aashishn86
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.