How use multi array to fill combo box?

jenn5175

Freshman
Joined
Apr 4, 2002
Messages
35
I am writing a small app in VB.NET with SDE. Because it will be a smart device app, I am trying to limit the number of times I hit the remote database. This means I want to read all of my data into arrays at the beginning of the app and then just use those arrays to populate multiple combo boxes. However, I cannot find a way to use a multidimensional array to fill a combo box (I need to display the first field of the array and the value to be the second field of the array). In VB6 I could use ItemData and NewIndex to assign both text and a number to a combobox item. But how in VB.NET?

This is how I was htinking but I'm stuck:

Dim array1(100,2) as string

'Fill Array form db
...

'Now fill first combobox
cmbo1.DataSource = array1
cmboBox1.DisplayMember = ??? (something like array1(0) but that's illegal)
cmboBox1.ValueMember = ?? (somehting like array1(1) but that's illegal)


anyone have any ideas??? I actually have a 4 fields for each record but only need 2 of them for the combobox and 2 for decisionmaking. Help!

Jenn
 
Back
Top