Click here to Skip to main content
15,860,859 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
my listbox contain same name
i want to select one of them but it select randomly

how we to find that i was selected write name to database

i use sql2005 and visual stdio 2008
Posted
Updated 14-Aug-14 2:22am
v2
Comments
[no name] 14-Aug-14 7:33am    
What?
Ashi0891 14-Aug-14 7:57am    
You question is completely incomplete.
[no name] 14-Aug-14 8:26am    
Based upon your "improvement" the answer to whatever your problem is, is pretty simple. Do not add duplicate entries to your listbox to begin with.

Use Distinct (Name) in your query and bind it in Listbox. Distinct will return unique names
 
Share this answer
 
In the ListBox, You can differentiate the two items because they have different indices in the Items collection. How to differentiate them in the database is up to you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900