Hi I have following scenario:
I have a set of queries which will return me set of DataTable objects. The datatable will have few rows columns that are identical and few columns that are unique to each table. for example
Table 1:
Name | Jan Data | Feb Data
A |10 |20
B |12 |9
Table 2:
Name | Mar Data | Apr Data | May Data
A |12 |21 |5
C |14 |90 |6
Now i want to merge these two data table objects. but while merging there are names such as A which is common to both tables and data varies. so i want an output such as:
Name | Jan Data | Feb Data | Mar Data | Apr Data | May Data
A |12 |21 |5 | 45 |52
B | 0 | 0 | |62 |21
C |14 |90 |6 |63 |42
the resultant table will have sum of each row value when grouped by name. (i did not take the trouble of calculating here apologies)
Can you suggest me an approach how this can be achieved?
I use C# 2.0
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…