根据组合框选择的索引chaged检索值时出现问题 [英] Problem in retrieving values according to combobox selected index chaged

查看:130
本文介绍了根据组合框选择的索引chaged检索值时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有品牌表和物品表。





品牌表物品表

BrandID品牌名称ItemID BrandID ItemName价格

1 a 1 1 x 15

2 b 2 2 x 20





我需要在组合框x和x中显示项目名称。在组合框选择的索引更改事件中,我需要检索速率并在文本框中显示。当我选择项目名称x和ItemID 2时,它显示速率15,项目名称x和ItemID 1也显示15.



这意味着如果重复的名称en计算,那么它取第一个值。





可以任意解释如何解决这个问题



谢谢

I have Brand Table and Item Table.


Brand Table Item Table
BrandID BrandName ItemID BrandID ItemName Rate
1 a 1 1 x 15
2 b 2 2 x 20


I need to display Item name in combobox x and x. In combobox selected index changed event I need to retrieve rate and display in a textbox. When ever i select Item name x with ItemID 2 it shows rate 15 and Item name x with ItemID 1 also shows 15.

Which means if duplicate name en counted then it takes the first value.


Can any1 explain how to over come this problem

Thanks

推荐答案

你可以使用数据表中的每一行将项目添加到组合框中

然后使用选定的索引从中获取数据通过使用它作为行索引来声明将从
u can add the items into the combobox using for each row in your data table
then use selected index to get data from the same table by using it as the row index to declare the row that you will get value from

获取值的行的相同表格

这篇关于根据组合框选择的索引chaged检索值时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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