如何从C#.net中的两个表向COMBOBOX添加项目 [英] How to add items to COMBOBOX from two tables in C#.net

查看:65
本文介绍了如何从C#.net中的两个表向COMBOBOX添加项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个组合框,为此必须添加两个表(SQL表)中的项目.

我该怎么做

提前致谢. plz紧急

I have one combobox, for this have to add items from the two tables(SQL Tables).

How can i do this

Thanks in advance. plz its urgent

推荐答案

如果表结构相似,则可以使用UNION子句.

例子
If your table structures are similar, you can use the UNION clause.

Example
select id1 as id, name1 as name from table1
UNION
select id2 as id, name2 as name from table2


这篇关于如何从C#.net中的两个表向COMBOBOX添加项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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