Hello All,
I am just wandering if anyone has a better way of implementing the following:
I am drawing search results (description of an item) from a database and populating them in a listbox. I need to map the element numbers, that are automatically allocated to the items when added to the lsitbox, to the description’s unique ID.
I can’t use an array because I don’t know the length of the search results. The only way to do this is to do a ‘count’ in the SQL statement then go back and populate the listbox and array. However this idea will be time consuming.
Another idea I have was to use a Vector (as they grow and shrink to your needs). The problem with this is that a Vector collection does not collect raw data types, which means each search result will be an object, which will use lots of memory.
The last way I thought of was to limit the search results to 50, that way I will be able to create an array of size 50 and just display a message requesting the user to narrow down the search criteria.
I was wandering if anyone had any better ideas for mapping the elements?
Thanks for your time,
Harold Clements