i have 1 listbox that contain : cloth, jeans, bra (directly from database) and 1 disabled textbox. The purpose is, when user click cloth or jeans or bra in listbox, textbox should show the price automatically, how can i do that??
this is my code to add item in list box :
Try
conn.Open()
Dim command As New MySqlCommand
Dim sqlquery As String = "SELECT * FROM collection"
Dim adapter As New MySqlDataAdapter
Dim data As MySqlDataReader
command.CommandText = sqlquery
command.Connection = conn
adapter.SelectCommand = command
data = command.ExecuteReader
While data.Read()
ListBox1.Items.Add(data(0).ToString)
End While
data.Close()
conn.Close()
Catch ex As Exception
MsgBox("System Error, please try again", vbCritical)
End Try
thx before for advice