vb.net 2008中的comboBox hashTable我如何使用它 [英] comboBox hashTable in vb.net 2008 how i can i use it

查看:68
本文介绍了vb.net 2008中的comboBox hashTable我如何使用它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个comboBox,
--------------- cboPosition -----------------

i have a comboBox,
---------------cboPosition-----------------

PositionCode <-------> PositionDecription
     1                    Manager
     2                    Supervisor
     3                    Asst. Manager
---------------cboDepartment---------------
DepartmentCode <-------> DepartmentDecription
     1                    Manager
     2                    Supervisor
     3                    Asst. Manager


listview = lvInformation
我使用的数据库是SQL 2008
我想使用哈希表和dataDictionary,以便我选择一个位置和部门,将其保存在数据库中而不是管理器中,它将保存到数据库中 为"1"(不含引号),这是我的数据库中Manager的代码. . .

请帮我:(

[edit]添加了代码块,并删除了问题的第二个副本:我认为是双重粘贴-OriginalGriff [/edit]


listview = lvInformation
Database i use is SQL 2008
i want to use a hashtable and dataDictionary so that ones i select a position and Department the that save in dataBase instead of Manager it will save to the dataBase
as "1" w/o quot which is the the code of Manager in my Data Base . . .

please help me :(

[edit]Code block added, second copy of the question removed: double paste I assume - OriginalGriff[/edit]

推荐答案

.

您始终可以将PositionCode绑定到组合框中的标签.因此,每次选择Manager时,都会选择适当的标签.

您还可以在字典中添加KeyValue对,如此处 [ ^ ].
There are a number of ways to do this.

You can always bind the PositionCode to the tag in the combo box. As a result, everytime you select the Manager, the appropriate tag is selected.

You can also add a KeyValue pair in the dictionary as shown here[^].


这篇关于vb.net 2008中的comboBox hashTable我如何使用它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆