View Single Post
  #1 (permalink)  
Old 04-24-2008, 08:38 PM
jaden403 jaden403 is offline
Newbie
 
Join Date: Apr 2008
Posts: 2
Credits: 0
Rep Power: 0
jaden403 is on a distinguished road
Default Merging datasets based upon primary key

I have two datasets with nothing in common except for the values in the first column of each (and the columns are named differently) that I am trying to merge and use in a DataGrid.

ds1 looks like:

Col1 Col2 Col3

100 Red Blue

200 Pink Yellow

ds2 looks like:

Column1 Column2 Column3 Column4 Column5 Column6

100 Wood Fire Rain Rocks Flowers

200 Grass Glass Trees People Things

What I am trying to accomplish is this:


100 Red Blue Wood Fire Rain Rocks Flowers
200 Pink Yellow Grass Glass Trees People Things

I know what to do, just not how to do it: that is, loop through each row of ds1. If the value of the first column of ds1 is equal to the value of the first column of ds2, add ds2 to that row in ds1. I have tried many things, but cannot get this to work correctly.

What am I missing?

Thanks!
Reply With Quote

Sponsored Links