I tried this:
Return objCustomers(lstCustomers.SelectedIndex)
and got the same error, so I looked around and found this
and tried it, to cast the array list entry as a customer object:
Return CType(objCustomers(lstCustomers.SelectedIndex),Cus tomer)
and it worked.
|