473,379 Members | 1,252 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Combine data from 2 tables in datagridview

Hi all.

I am trying to combine data from 2 tables in one datagridview.

I have tables: "Customer" and "CustomerContact".

I want to display Customer information (displaying all fields in customer and some fields from customercontact) in a datagridview. I am not using sql so innerjoin is not possible....

The relation between the tables are: Customer.c-custno = CustomerContact.cc-custno.

How can i do this ?
Any example code i can look in ?
(i am new to c# to explain easyly....)

Thanks.

Lars E.
Apr 25 '06 #1
1 3411
Hi,

What you can do is either add the columns from the second table to the
first using a referenced expression (See DataColumn.Expression )

Or create a new table where all the columns are referenced expressions.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

<Lars E.> wrote in message news:%2*****************@TK2MSFTNGP02.phx.gbl...
Hi all.

I am trying to combine data from 2 tables in one datagridview.

I have tables: "Customer" and "CustomerContact".

I want to display Customer information (displaying all fields in customer
and some fields from customercontact) in a datagridview. I am not using
sql so innerjoin is not possible....

The relation between the tables are: Customer.c-custno =
CustomerContact.cc-custno.

How can i do this ?
Any example code i can look in ?
(i am new to c# to explain easyly....)

Thanks.

Lars E.

Apr 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: martin1 | last post by:
rHi, All I knew cross-tab quesy is easy done on the Access DB, is there easy way to do cross-tab query for SQL server DB in VB.NET 2005 Dev environment? Thanks
2
by: Rick Shaw | last post by:
Hi, I have a problem with the datagridview not refreshed when the application first appear on the screen. The datagridview display data from a table in the dataset. At the same time, I've added...
9
by: trint | last post by:
How can I retrieve all of the data from a datagridview? Any help is appreciated. Thanks, Trint
1
by: weird0 | last post by:
How can i update the data in my database directly through datagridview....? Can anyone tell me the appropriate links and what is the exact event in datagridview that handles it and some explanation...
4
by: =?Utf-8?B?UmludSBHb3BhbGFrcmlzaG5hIFBpbGxhaQ==?= | last post by:
Hi All, I have an application that fetch data thru a store proc and display in a datagrid, but after successful execution of proc the data grid is not visible.Please go thru the following code...
1
by: Amit | last post by:
Hello , Is there any way i can import data from datagrid to sqlserver. please advise . thanks & Regards
1
by: bluereign | last post by:
Thank you for your assistance. I am a novice looking to JOIN and append or combine records from 2 current Tables into 2 new Tables named below. I have been able to JOIN Tables with the script...
6
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1)...
6
by: Wesley Peace | last post by:
I hate to cross post, but I've gotten no answer yet on a problem I'm having with visual studio 2008. I've created a series of forms with controls to access a Access database tables. The...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.