I am upgrading my application from vb6 to vb.net.
I used to populate my data in datalist control in vb6 forms. I am not finding it in vb.net windows form application. Which one control is the equivalent to it?
How can i list my data in that control?
just like: I had a table with data like id, name
I want the name should be the displayed column and id the bound column? how can i do that
I'm not exactly sure but I think you're looking for a
ListBox
. You create a class with 2 members and a property for each (suggested property namesID
andName
), create a list of them and put all your data in there and then just set the 'ListBox.DisplayMember' to "Name" andListBox.ValueMember
to "ID".The MSDN page for
ListControl.DisplayMember
has a full sample showing how to do it as can be seen here.Though I'd suggest that you use a
List(Of YourClass)
rather than theArrayList
in the sample.