f_id | illness | symptoms
1 | fever | dizziness
2 | fever | cold
3 | fever | hot temperature
4 | asthma | dizziness
5 | asthma | difficulty in breathing
6 | asthma | pale
so if user select fever from combobox, listbox will have dizziness, cold, hot temperature. I've already tried something but its not working:
Expand|Select|Wrap|Line Numbers
- Dim dtr As MySqlDataReader
- Dim cmd As New MySqlCommand
- With Me
- Call Connect()
- cmd.Connection = myConn
- cmd.CommandText = STRSQL
- STRSQL = "select sym from symptoms where ill = @rec"
- cmd.Parameters.AddWithValue("rec", cmbRecord.Text)
- dtr = cmd.ExecuteReader
- Dim symp As New List(Of String)
- While dtr.Read()
- symp.Add(dtr("symptoms"))
- End While
- lstSymp.DataSource = symp
- dtr = Nothing
- cmd = Nothing
- myConn.Close()
- Call Disconnect()
- End With