|
-
Jun 29th, 2009, 02:44 AM
#1
Thread Starter
Lively Member
Comparing Listbox Values
Hi there,
I have five listboxes that are populated from five different datasources basically I have connected to an MS Access database and I am running SQL queries effectively so the five listboxes are populated via datatables for example dtInterests, dtHobbies, dtMovies, DtTV and dtMusic
my question is how would I compare the values that are being stored in each listbox I want the application to check each of the five listboxes and if the value is the same (in my case the valuemember is the customer id) then store the result somewhere (in a textbox)
thank for any help in advance
-
Jun 29th, 2009, 02:56 AM
#2
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.
-
Jun 29th, 2009, 03:26 AM
#3
Thread Starter
Lively Member
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
-
Jun 29th, 2009, 11:17 AM
#4
Frenzied Member
Re: Comparing Listbox Values
So like a dating service, Customer2 has the X amount of interests from each of the listboxes as Customer1?
-
Jun 29th, 2009, 01:44 PM
#5
Thread Starter
Lively Member
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!
-
Jun 29th, 2009, 02:20 PM
#6
Frenzied Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|