Hi there,
I have problem with my DropDownBox, my datasource is from MySQL database. My problem is this, I have already stored data in my database let's say 12 rows, but when I am trying to fetch it on to dropdownbox, only 11 data will be the item values of the dropdownbox.
myconnstring = "datasource=localhost;username=root;password=*******;database=**********;"
comm = "SELECT * FROM players WHERE `team`='" & TeamBox.Text & "';"
conn = New MySqlConnection(myconnstring)
Try
conn.Open()
Try
myCommand.CommandText = comm
myCommand.Connection = conn
myReader = myCommand.ExecuteReader
While myReader.Read
If SPTexbox.Items.Count <= 12 Or SPnumTexbox.Items.Count <= 12 Then
SPTexbox.Items.Add(myReader("playernam"))
SPnumTexbox.Items.Add(myReader("plnum"))
End If
End While
conn.Dispose()
Catch myerror As MySqlException
'error message
End Try
Catch myerror As MySqlException
'error message
End Try
Datas from table row's 1-10 and 12, row 11 is not included.