Populate ListBox control from two different tables?

Hi, I populate ListBox control from two different tables, the problem that I'm facing is how can I know when I retrieve the items from ListBox which one is belong to a partticular table because ListBox's items only have text and value it cannot take another third parameter that I can use to know if that item belong to a particular table, any suggesstion?
LVL 3
Abdu_AllahAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jorge PaulinoIT Pro/DeveloperCommented:
Do you fill the values manually ?
You can add an extra sign to your value member to identify if belongs to one or another.
Example, for the ID 123 you can use TA123 and TB123. This way you know that the first two chars identify the table.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Abdu_AllahAuthor Commented:
Actually I thought about something like that but isn't there any other direct way?
Abdu_AllahAuthor Commented:
By the way I'm populate them like this:
lstbx.DataSource = objReader
lstbx.DataTextField = "item"
lstbx.DataValueField = "id"
So I do not think it's possible to add chatacters to the id column unless there is a way to do that in the SQL, here is my SQL statment just in case:

SELECT [user].user_id AS id,[user].Full_Name AS item FROM [user] UNION SELECT gr.group_id AS id,gr.Name AS item FROM [group] AS gr;

Open in new window

Jorge PaulinoIT Pro/DeveloperCommented:
You can use another control to do that, like listview or gridivew, and that way you can add an extra column and hide it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.