Private Sub CBSEC2_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CBSEC2.SelectedValueChanged
Dim sql As String = ""
If CBSEC2.SelectedValue = "SEC-01" Then
sql = "select From Employee where Section_Id = 'SEC-01'"
ElseIf CBSEC2.SelectedValue = "SEC-02" Then
sql = "select From Employee where Section_Id = 'SEC-02' "
ElseIf CBSEC2.SelectedValue = "SEC-03" Then
sql = "select From Employee where Section_Id = 'SEC-03' "
ElseIf CBSEC2.SelectedValue = "SEC-04" Then
sql = "select From Employee where Section_Id = 'SEC-04' "
End If
With cn
If .State = ConnectionState.Open Then .Close()
.ConnectionString = strconn
.Open()
End With
'Dim s44 As String = " select *from Employee"
Dim da3 As New SqlDataAdapter(sql, cn)
Dim ds3 As New DataSet
da3.Fill(ds3, "Emp")
With CBEMP
.DisplayMember = "Emp_Name"
.ValueMember = "Emp_Id"
.DataSource = ds3.Tables("Emp")
End With
cn.Close()
End Sub
End Class