组合框中的查找列 [英] lookup column in combobox

查看:54
本文介绍了组合框中的查找列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hello.i有一个组合框,它应该显示来自表的3列值,例如c中的id,name,lname在c#中的表单应用程序

 



我做什么?

解决方案

你需要通过这个链接:从C#中的数据库表中显示多个列到ComboBox中 [ ^ ]


在绑定到组合框之前,创建新字段(让我们称之为fullName)并将其绑定到DisplayValue



  SELECT  id,name,lname,fullName = '  (' + id + ' )'  +名称+ ' ' + lname  FROM  your_table 





如果您正在使用某些类,集合或其他类型的绑定,则必须将上述SQL示例调整为特定的绑定方法。



如果这有帮助请花点时间接受解决方案


请参考



多列组合框 [ ^ ]



< a href =http://www.dotnetfunda.com/forums/show/6294/display-two-column-values-in-a-combo-box> http://www.dotnetfunda.com/forums/show / 6294 / display-two-column-values-in-a-combo-box [ ^ ]

hello.i have a combo box which should show 3 column value from table e.g,"id","name","lname" in windows form application in c#


what i do?

解决方案

You need to go through this link : Display Multiple Columns Into ComboBox From Database Table in C#[^]


Before binding to combobox, create new field (lets call it fullName) and bind it to DisplayValue

SELECT id, name, lname, fullName = '(' + id + ') ' + name + ' ' + lname FROM your_table



If you're using some class, collection or other type of binding, you have to adjust the above SQL example to your particular bind method.

If this helps please take time to accept the solution


Please refer

Multi Column ComboBox[^]

http://www.dotnetfunda.com/forums/show/6294/display-two-column-values-in-a-combo-box[^]


这篇关于组合框中的查找列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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