Two Tables In DataGridView
Hi all i want to display two unrelated tables in the same datagridview. I m using merge method of datasets but in vain. Any idea Plz
Gaurav arora
Junior Poster in Training
59 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
Dare I ask why? Why not use 2 different views next to each other?
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
Actually I want it to be done throuth DataSets. Actually it is an assignment
Gaurav arora
Junior Poster in Training
59 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
I meant dataviews as in table on the form, I was expecting it to be 2 datasets.
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
Yes LIZr I have 2 DataSets And i Have Merged Them through Merge method of datasets. But Still I m not getting my result
I have Tried following
ds1.Merge(ds2);
dataGridView1.DataSource = ds1.Tables[0].DefaultView;
Any idea plz
Gaurav arora
Junior Poster in Training
59 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
K, but merge probably doesnt do what you're expecting.
Im guessing if you had tables such as
Table 1
--------
id value
1 5
2 10
and
table 2
--------
uid name
3 john
4 sarah
Im guessing you wanted
id value uid name
1 5 3 john
2 10 4 sarah
yes?
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190