As seen from the following code given in the question, the sid is set from ComboBox1
sid = ComboBox1.SelectedItem.ToString
sid = sid.Substring(0, 9)
which is used later in the
sqlcommand
to retrieve data from the database.
Whereas the
ListBox1_SelectedIndexChanged
event is used to change the image in the
PictureBox
.
This may be the reason as the selection change in
ListBox1
will not be reflected in
ComboBox1
. Please check.