Visual Basic .NET » Windows Forms
listbox mysql -- Talk2Tom11 --


I am reading information from a mysql database into a listbox. The query that i have should only return one column from the database. But when displayed in the listbox that same column is written 4 times. this is my code for the listbox...

VB.net:

While myReader.Read()
'ProgressBar1.Value = ProgressBar1.Value + 5
ListBox2.Items.Add(myReader.GetString(0) + ": " +
myReader.GetString(1) + ", " + myReader.GetString(2))

End While

Does anyone know why this would display the same thing 4 times???

When i run the same query through mysql directly... it comes out right but only when doing it through VB is multiplies

-- Anandi --


Why you are using the while loop? (check this condition for only end of record .etc.)
Try use only one GetString .....

With regards,
Johnson

[Submit Comment]Home