将列添加到DataGridView现有列 [英] Add Columns to DataGridView Existing Columns

查看:91
本文介绍了将列添加到DataGridView现有列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的DataGridView视图

StudRoll没有名称
1 AAA
2 BBB
3 CCC

我想将列添加到主题表"的DataGridView中,这也是在选择使用数据表使用标准"到现有列(例如StudRollNo,Name
)后进行的
我想要这样

StudRollNo Name英语数学历史
1 AAA
2 BBB
3 CCC

任何人都可以提出建议的方式....

提前thx....

I Have DataGridView View like this

StudRollNo Name
1 AAA
2 BBB
3 CCC

I want to Add Columns to DataGridView of Subjects Table which is also comes after selecting Standard using Datatable to Existing columns like StudRollNo,Name

I want Like This way

StudRollNo Name English Maths History
1 AAA
2 BBB
3 CCC

Can any one suggest the way....

thx in advance....

推荐答案

根据我的理解,下面可能是实现此目标的实现方式

假设您有以下两个表格

表1:学生


RollNumber 名称
1 AAA
2 BBB
3 CCC


表2:主题


RollNumber 英语 数学 历史
1 50 60 70
2 40 45 50
3 35 65 38


那么您的查询将是

As per my understanding below could be the implementation to achieve this

suppose you have two table as per below

Table1 : Student


RollNumberName
1AAA
2BBB
3CCC


Table2 : Subject


RollNumberEnglishMathsHistory
1506070
2404550
3356538


then you query will be

SELECT S.Rollnumber,S.Name,Sub.English,Sub.Maths,Sub.History
 FROM Student S inner join Subject Sub On S.RollNumber=Sub.RollNumber



希望这对您有所帮助,然后接受我的回答并投票,否则请返回您的查询.
--Rahul D.



Hope this helps if yes then accept my answer and vote as well otherwise revert back with your queries.
--Rahul D.


这篇关于将列添加到DataGridView现有列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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