Two Tables In DataGridView

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2007
Posts: 59
Reputation: Gaurav arora is an unknown quantity at this point 
Solved Threads: 0
Gaurav arora Gaurav arora is offline Offline
Junior Poster in Training

Two Tables In DataGridView

 
0
  #1
Nov 28th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Two Tables In DataGridView

 
0
  #2
Nov 28th, 2008
Dare I ask why? Why not use 2 different views next to each other?
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 59
Reputation: Gaurav arora is an unknown quantity at this point 
Solved Threads: 0
Gaurav arora Gaurav arora is offline Offline
Junior Poster in Training

Re: Two Tables In DataGridView

 
0
  #3
Nov 28th, 2008
Actually I want it to be done throuth DataSets. Actually it is an assignment
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Two Tables In DataGridView

 
0
  #4
Nov 28th, 2008
I meant dataviews as in table on the form, I was expecting it to be 2 datasets.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 59
Reputation: Gaurav arora is an unknown quantity at this point 
Solved Threads: 0
Gaurav arora Gaurav arora is offline Offline
Junior Poster in Training

Re: Two Tables In DataGridView

 
0
  #5
Dec 3rd, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Two Tables In DataGridView

 
0
  #6
Dec 3rd, 2008
K, but merge probably doesnt do what you're expecting.

Im guessing if you had tables such as

  1. Table 1
  2. --------
  3.  
  4. id value
  5. 1 5
  6. 2 10
and
  1. table 2
  2. --------
  3. uid name
  4. 3 john
  5. 4 sarah

Im guessing you wanted
  1. id value uid name
  2. 1 5 3 john
  3. 2 10 4 sarah

yes?
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 32
Reputation: reena12 is an unknown quantity at this point 
Solved Threads: 4
reena12 reena12 is offline Offline
Light Poster

Re: Two Tables In DataGridView

 
0
  #7
Dec 5th, 2008
Hi,
try this

ds1.Merge(ds2);
dataGridView1.DataSource = ds1.Tables[0];
dataGridView1.DataBind();
Reena Mehta

Remember to click on Mark as answer on the post that helped

http://www.indianic.com
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1815 | Replies: 6
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC