What is the best way to populate a combobox and a listbox? I need to populate them from a database. I can do it with the following code:
While dr.Read
Me.lstClassifications.Items.Add(dr.GetValue(1))
End While
but I am not sure that I am getting id's along with the display value.
I am using a datareader but when I use the code that I find here I get an unhandled exception.
This is for a window application using VB.NET.
Please help
Thanks,
enak.
While dr.Read
Me.lstClassifications.Items.Add(dr.GetValue(1))
End While
but I am not sure that I am getting id's along with the display value.
I am using a datareader but when I use the code that I find here I get an unhandled exception.
This is for a window application using VB.NET.
Please help
Thanks,
enak.