关于Datagridview [英] Regarding Datagridview

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

问题描述

我想在单个DataGridView中一个接一个地显示2个表值.怎么可能.我需要在C#.net中进行编码.

请帮助我,我是C#.net的初学者.

I want to display 2 table values one by one in single DataGridView. how it is possible. I need coding in C#.net.

Please help me I''m beginner to C#.net.

推荐答案

您的问题尚不完全清楚,但我假设您的意思是要显示2中的数据表.

这与C#无关,而与如何从有关表中检索数据有关.

没有您的更多信息,很难精确说明,但是无论您使用的是DBMS,您都可能需要某种 JOIN [ ^ ]语句在您的SQL中.
Your question is not entirely clear but I am assuming that you mean that want to display data from 2 tables.

This has little to do with C# and more to do with How you retrieve the data from the tables in question.

Without more information from you, it is difficult to be precise but regardless of the DBMS you are using you will probably require some sort of JOIN[^] statement in your SQL.


我为C ++/CLI .NET的一家虚构的运输公司编写了代码,其中passengermaster表具有从route和stage表中提取的route和stage标识符,这些标识符均来自mySQL数据库

注册新乘客后,它必须在人员表上(从网格上的组合单元格中选择),然后从第二个组合单元格中为该乘客选择一条路线,人员和路线组合不会更改,但用于阶段将显示不同的值,具体取决于所选的路线.

我的datagridview基于Linda Liu解决方案,可在此处找到 www.ms-windows.info /Help/different-combobox-row-datagridview-9185.aspx .向下滚动到解决方案2.

问候
Ger
I have code written for an imaginanry transport company for C++/CLI .NET where the passengermaster table has route and stage identifiers drawn from route and stage tables all feeding from a mySQL database

When a new passenger is registered, it must be on the person table (picked from a combo cell on the grid), then a route is selected for the passengerfrom a second combo cell, people and route combos dont change, but the combo cell for stages will show differant values depending on the route selected.

My datagridview is based on a Linda Liu solution found here www.ms-windows.info/Help/different-combobox-row-datagridview-9185.aspx . Scroll down to Solution 2.

Regards
Ger


两个表的表结构是什么.
如果要同时显示两个表的数据,则需要在SQL查询中使用join.
如果您要一个接一个地显示数据,则需要使用
sql查询中的并集.
what is the table structure of both the tables.
if u want to display data of both the tables side by side then u need to use join in your sql queries.
If u want to display data one after another table then u need to use
union in sql queries .


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

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