|
||||||
| C# Programming C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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! |
| Sponsored Links |
|
|
|
|||
|
That's what I had to end up doing.
loop through ds1 rows loop through ds2 rows loop through ds1 columns loop through ds2 columns look for matching values copy columns from ds2 in ds1 I just thought there would be an easier way to do that than using nested loops. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Web Based IDE | drussoPD | Website Design | 5 | 07-24-2007 03:02 PM |
| Asp.net and datasets | reachpradeep | ASP, ASP.NET and Coldfusion | 0 | 03-05-2007 08:01 AM |