I want to add items in a ComboBox. I have two array().
Dim purpose_list() As String = {"ADMISSION", "1ST", "2ND", "3RD", "4TH", "5TH", "6TH", "7TH", "8TH", "9TH", "10TH", "11TH", "12TH"}
and
Dim find_purpose = GetListOfPurpose()
The function GetListOfPurpose() is like below..
Private Function GetListOfPurpose() As List(Of String)
Dim Output As New List(Of String)()
Try
OpenConnection()
Dim st_roll As String = TbRoll.Text
Dim c_id As String = CmbCourse.SelectedValue
Dim cmd As New MySqlCommand
Dim qry As String = "SELECT purpose FROM fee_payment WHERE roll_no='" + st_roll + "' AND course='" + c_id + "'"
cmd.Connection = conn
cmd.CommandText = qry
Dim dr As MySqlDataReader = cmd.ExecuteReader
While dr.Read
Output.Add(dr("purpose").ToString())
End While
dr.Close()
Catch ex As Exception
MsgBox(ex.Message)
Finally
CloseConnection()
End Try
Return Output
End Function
Now I want to find strings in find_purpose and if exists, remove those strings and add the rest into a ComboBox.
Like if find_purpose contains "1ST" and "3RD", the ComboBox will add the rest items
"ADMISSION", "2ND", "4TH", "5TH", "6TH", "7TH", "8TH", "9TH", "10TH", "11TH", "12TH"
I have found This thread but it is in php.
What should I do it in VB.NET ?