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