I am trying to populate a Combobox from a MySQL database; but I don't get anything. Below is the code.
Table: Class
Columns: Code, State
sqlstr = "SELECT * FROM Class WHERE State= Not Started"
DBCmd = New MySql.Data.MySqlClient.MySqlCommand(sqlstr, DBConn)
DBDR = DBCmd.ExecuteReader
While (DBDR.Read())
CB_Class.Items.Add(DBDR("Code"))
End While
DBCmd.Dispose()
DBDR.Close()
I believe the result is wrong, because there are at least 2 records with their state values set as "Not Started". What is wrong? Is there anything wrong with the way I've written "State= Not Started" ?