C
Craig Lister
I'm a Delphi developer, trying my hand at c#
A simple question, I am sure:
I'd populate a ComboBox in Delphi, with values from a table, and then at the
same time, populate a TStringList with the corresponding ID's of the items
going into the ComboBox.
Eg:
select id, description from table
loop through results {
add 'Description' to ComboBox;
add 'ID' to StringList;
}
then, on selection of the item in the combobox:
return item = StringList[ ComboBox.ItemIndex ].value;
So, now, how is this achieved in c# ?
Would you declare some time of stringlist? Or maybe the ID can be stored in
the ComboBox?
Websites:
http://www.thelisters.co.uk/
http://www.myschoolmates.com/
A simple question, I am sure:
I'd populate a ComboBox in Delphi, with values from a table, and then at the
same time, populate a TStringList with the corresponding ID's of the items
going into the ComboBox.
Eg:
select id, description from table
loop through results {
add 'Description' to ComboBox;
add 'ID' to StringList;
}
then, on selection of the item in the combobox:
return item = StringList[ ComboBox.ItemIndex ].value;
So, now, how is this achieved in c# ?
Would you declare some time of stringlist? Or maybe the ID can be stored in
the ComboBox?
Websites:
http://www.thelisters.co.uk/
http://www.myschoolmates.com/