Click here to Skip to main content
15,358,946 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

[no name] 18-Jul-13 6:21am
You want someone to explain to you what you have done incorrectly without seeing your code? How would you expect that to happen?
Amitava Bag (Kolkata) 19-Jul-13 3:52am
I support you. There are so meny method to display in combobox, like binded data with datatable, binded data with entity, unbinded data (just add item). It is not possible to trace the actual error in your case without code. I can suggest you to set that combo as dropdownlist and then try once. Just a try.......
maneavnash 18-Jul-13 10:20am
change your ItemName . and check it
i think duplicate name

1 solution

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

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