如何使用vb.net查看主键关联外键的值 [英] how can see value of primary key associated foreign key using vb.net

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

问题描述

我有两个tbl

1-loadingpoint

2-rates



我装载点id(pk),loadingpointname with textbox。



的费率id(pk),fromid(fk)与loadingpoint tbl相关联。

i可以看到在访问2003格式中使用查找值加载名称。

但是当使用带窗口形式和文本框的vb2005时,我只能看到加载点tbl中的id数而不是装货点名称。 我有两个tbl

1-loadingpoint

2-rates



在加载点我用id(pk),loadingpointname用文本框。



的费率id(pk),fromid(fk)相关联与装载点tbl。

i可以看到在访问2003格式中使用查找值加载名称。

但是当使用带窗口形式和文本框的vb2005时,我只能看到加载点tbl中的id数而不是装载点名称。

i have two tbl
1-loadingpoint
2-rates

in loading point i made id (pk),loadingpointname with textbox.

in rates id(pk),fromid(fk)associated with loadingpoint tbl.
i can see loading name with lookup value in access 2003 format.
but when using vb2005 with window form and textbox i can see only number of id from loading point tbl instead of loadingpoint name.i have two tbl
1-loadingpoint
2-rates

in loading point i made id (pk),loadingpointname with textbox.

in rates id(pk),fromid(fk)associated with loadingpoint tbl.
i can see loading name with lookup value in access 2003 format.
but when using vb2005 with window form and textbox i can see only number of id from loading point tbl instead of loadingpoint name.

推荐答案

检查出来:如何从VB.Net中的数据集填充组合框 [ ^ ]

组合框有2个属性ValueMember和DisplayMember。

id应该绑定到ValueMember,而loadingpointname绑定到DisplayMember。
Check this out: How to populate a combo box from a dataset in VB.Net[^]
There are 2 properties ValueMember and DisplayMember for the combo box.
The id should be bound to the ValueMember, while the loadingpointname bound to the DisplayMember.


这篇关于如何使用vb.net查看主键关联外键的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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