我有一个现有的sql数据库,它有2列数据(部分和变量),另一个我们的系统在同一个数据库中的不同表中使用sql但列是(部分和类型),我将如何合并两个在datagridview(part,variant和type)中使用part来执行select语句,以便拉出另外两位信息并将它们包含在同一个datagridview中。在vb.net
干杯, 皮特
答案 0 :(得分:0)
我的猜测是你需要一个外连接来获取数据,假设有一个唯一的密钥而且它是“部分”,例如:
Select part, variant
from table1
UNION ALL
select part, type
from table2;
假设每个表都是唯一的,并且与part无关,也没有关键:
<div ng-controller="cPswd">
<form id="form" autocomplete="off" name="form" novalidate>
<div>
<label for="password">password</label>
<input id="password" name="password" type="password" value="" maxlength=4 ng-model="pwd.password" required />
</div>
<div>
<label for="cpassword">confirm password</label>
<input id="cpassword" name="cpassword" type="password" value="" maxlength=4 ng-model="pwd.cpassword" compare-to="pwd.password" required />
</div>
<button ng-disabled="form.$invalid">Submit</button>
</form>
</div>
这是ANSI SQL,因此您可能必须使其适应SQL Server语法,但我认为其意图很明确。
将结果集绑定到DataGridView。
这回答你的问题吗?
R / 普雷斯科特......