如何在列表框中区分重复的名称 [英] How to differenciate duplicate name in list box
本文介绍了如何在列表框中区分重复的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的列表框包含相同的名称
i想要选择其中一个,但它会随机选择
我们如何找到我被选中写名称到数据库
i使用sql2005和visual stdio 2008
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
推荐答案
在你的使用区别(名称)查询并在Listbox中绑定它。 Distinct将返回唯一名称
Use Distinct (Name) in your query and bind it in Listbox. Distinct will return unique names
在 ListBox
中,您可以区分这两个项目,因为它们在<$ c $中有不同的索引c>项目集合。如何在数据库中区分它们取决于你。
In theListBox
, You can differentiate the two items because they have different indices in theItems
collection. How to differentiate them in the database is up to you.
这篇关于如何在列表框中区分重复的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文