C#检索存储的值,并从组合框显示为text属性 [英] C# Retrieve stored value and display in text property from a Combobox

查看:139
本文介绍了C#检索存储的值,并从组合框显示为text属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应使用存储在一个表(表1)中的键值(整数)来设置组合表中第二个表(表2)中的数据(字符串)的text属性.

table1值(int)
-------------
1
1
2
1
3

table2值(整数,字符串)
-------------
1,一个"
2,两个"
3,三个"

通过将字符串值绑定到组合框文本值,从table1检索的记录应在组合框文本属性中显示来自table2的字符串值.

前任.整数值2应该在组合框文本属性中显示字符串"Two".

希望您能提供帮助.

Ivor

A key value (integer) stored in one table (table1) should be used to set the text property from a combobox build from data (string) in a second table (table2).

table1 values (int)
-------------
1
1
2
1
3

table2 values (int, string)
-------------
1, "One"
2, "Two"
3, "Three"

A record retrieved from table1 should display the string value from table2 in a combobox text property by binding the string value to the combobox text value.

ex. the integer value 2 should display teh string "Two" in the combobox text property.

Hope you can help.

Ivor

推荐答案

这听起来像是作业,但我会帮忙的.

This sounds like homework but I''ll help some.

SELECT t1.ID, t2.Value
FROM table1 t1 
INNER JOIN table2 t2 ON t1.ID = t2.ID


这篇关于C#检索存储的值,并从组合框显示为text属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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