Click here to Skip to main content
15,921,169 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 27-Dec-10 1:49am
v2

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.
 
Share this answer
 
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
 
Share this answer
 
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 .
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900