hi to all. I want to store two values in combobox, like in html. the first value is what the users can see and the second value is the hidden value which i want to put in the database. for example I have a database table named person with ID, NAME field. yes i can put the list of name in a combobox but all i want is if the users select a name from list its value is the id which i want to put in the other table.. pls help. thank you……………..
See the documentation for AddObject method. You will have to reinterpret_cast (this is C++, sorry I don't know the equivalent in Delphi) the TObject* pointer into your datatype.
If the value you need to store is <= 32 bits then all is fine, otherwise you will have to manage dynamic (de)allocation (in which case it may be easier to maintain a separate array like Sergei explained).