Hello everybody,
I have on the form combobox populated with names of patients. If the user
changes the selectedindex, the respective patient data appear.
Private Sub frmNursing_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
dtPatients = GetDataTable(OpenConnection, SQLString)
Me.cmbPatients.SelectedIndex = 0
end sub
Private Sub cmbPatients_SelectedIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles cmbPatients.SelectedIndexChanged
dtnursing = GetDataTable(OpenConnection, "select * from nursing where
PatientID = " &
CInt(dtPatients.Rows(Me.cmbPatients.SelectedIndex).Item("PatientID").ToString()))
bs.DataSource = dtnursing
End Sub
Now some customers told me that sometimes happens after setting the
selectedindex to the first name (selectedindex 0) that instead of data of
patient 1 some other or recent added data of other patients appear. After
closing and starting the form the correct data appear.
I could not reproduce this behavior but maybe there is a problem in my code
that I am not able to see.
Can you help me?
Thanks
Mario
|