i'm working on an e-voting system for my thesis... but i'm having problem on how to output the data in all the rows in the database in a check box. so it means that the number of checkbox is equals to the row of the table. i manage to output only one data from the first row but i don't know how can i output all the succeeding rows. hope you could help me.
this is my code so far
Private Sub LoadCandidates()
SqlString = "SELECT * FROM candidate"
'Function for searching by candidate ID number
Using conn As New MySqlConnection(ConnString)
Using cmd As New MySqlCommand(SqlString, conn)
cmd.CommandType = CommandType.Text
conn.Open()
Using reader As MySqlDataReader = cmd.ExecuteReader()
If reader.HasRows = True Then
While reader.Read()
CheckBox1.Text = reader("candidateLname").ToString
End While
End If
End Using
End Using
End Using
End Sub