title: VB If Else Statement not working in Combo box
body: <p>I have a combo box for the selection of subjects according to semester. Like if first semester, then these will be the subjects and so on. My combo box is already populated that came from my database. My problem is, even it is First semester, the subjects shown on the combo box are the subject for the Second semester. I have this feeling that the error has nothing to do with my queries but in the condition itself. </p>
  
  <pre><code>Private Sub fillsubjectcombo()
  
      If yearlabel.Text = "Grade 11" Or course_label.Text = "STEM" Or semester_label.Text = "Second semester" Then
  
          Dim str As String
  
          con.Close()
          con.Open()
  
          str = "SELECT* FROM [Subjects] ORDER BY [STEM G11 SS]"
          cmd = New SqlClient.SqlCommand(str, con)
          cmd.CommandText = str
          cmd.Connection = con
          drd = cmd.ExecuteReader
          subject_cbx.Items.Clear()
  
          While (drd.Read())
  
              subject_cbx.Items.Add(drd("STEM G11 SS"))
  
          End While
  
          cmd.Dispose()
          drd.Close()
          con.Close()
  
      End If
  
      If yearlabel.Text = "Grade 11" Or course_label.Text = "STEM" Or semester_label.Text = "First semester" Then
  
          Dim sti As String
  
          con.Close()
          con.Open()
  
          sti = "SELECT* FROM [Subjects] ORDER BY [STEM G11 FS]"
          cmd = New SqlClient.SqlCommand(sti, con)
          cmd.CommandText = sti
          cmd.Connection = con
          drd = cmd.ExecuteReader
          subject_cbx.Items.Clear()
  
          While (drd.Read())
  
              subject_cbx.Items.Add(drd("STEM G11 FS"))
  
          End While
  
          cmd.Dispose()
          drd.Close()
  
          con.Close()
  
      End If
  </code></pre>
  
  <p>Can anyone help me? Please :(</p>