Re: Comparing Listbox Values
You're going to have to provide a more complete explanation. Do all of these DataTables have a CustomerID? Are you interested in every item in every list or just the selected items? Etc. Please provide a full and clear description of the problem each time you start a thread.
Re: Comparing Listbox Values
Yes i need to compare the whole list of each listbox and match which items are the same and the customer id (cust_id) is the value which is grabbed from the database yes
Re: Comparing Listbox Values
So like a dating service, Customer2 has the X amount of interests from each of the listboxes as Customer1?
Re: Comparing Listbox Values
yes this is exactly right i need to match customers intrests from the populated listboxes and if for example all five listboxes contain the same customer id then it will be a very good match!
Re: Comparing Listbox Values
So then what you would need to do is loop through each list box and compare customer2 items to customer1 items, store the like items for each list box.
What I would be using is a CheckedListBox not a ListBox where you add all of the possible items you can think of. This would make running a query to check each list box for customer2 to customer1 much easier. Just compare the checked values are the same, and then say return any records where the count equals a certain amount.