Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ArrayList 1

Status
Not open for further replies.

slimroberts1

Programmer
Jan 30, 2003
5
0
0
IE
Can any one tell me how to do the following. At the moment I create an new arraylist.
ArrayList Code = new ArrayList()
I then pass this to a class function which will load the array with a field from a table.
I then on the return from loading assign the array to a combo box
cbCatCode.DataSource = Code;
Now this all works But ! I would like to load the array with say 2 fields not just one.
Then assign just one on the array items to the combobox
so array has :
code name
code name
code name
and so on then I just want the code part to display in the combo.
Can this be dun.
Many thanks
Slim
 
Not sure if ArrayList can have multidimensions, maybe you can try that?

ArrayList Code = new ArrayList();
--load with data--

ArrayList Name = new ArrayList();
--load--

ArrayList CodeANDName = new ArrayList(2);
CodeANDName.Add(Code);
CodeANDName.Add(Name);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top