I'm switching from VB6 to C#
With VB6 I could assign a recordsets ID number to the index so that when you selected values in a listbox or combobox I could use those values to pull records or update records from/in the database.
In the above example the listbox would show a persons last name and when I selected that person the value to be used to update their information would be based off of the persons "PersonnelID"
Is there a way to do that with a listobx in C# ?
I can populate the listbox, get counts, text values etc. but I have not found the equivilant to my question above.
With VB6 I could assign a recordsets ID number to the index so that when you selected values in a listbox or combobox I could use those values to pull records or update records from/in the database.
Code:
lstPersonnel.AddItem rs.("LName").Value
lstPersonnel.ItemData(lstPersonnel.NewIndex) = rs("Personnelid").Value
In the above example the listbox would show a persons last name and when I selected that person the value to be used to update their information would be based off of the persons "PersonnelID"
Is there a way to do that with a listobx in C# ?
I can populate the listbox, get counts, text values etc. but I have not found the equivilant to my question above.