SCHEID ACTIVITYID PID Quantity Amount
2 12 100 200 2000
2 12 101 300 2500
2 15 102 400 1400
2 15 103 120 2000
This is what i managed to get from join query using three tables in linq, how can i add quantity, amount depending on ActivityID, and i want to display both activityid value which belongs to same scheme
Please Help me out....
ie, i whant output .....
Scheme ActivityID Quantity Amount
2 12 500 4500
2 15 520 3400
Loading
Ramesh MaruthiPosted Aug 21, 2014, 10:12 AM
group k by new {
k.Scheme,
k.ActivityID
} into g
select new {
g.Key.Scheme,
g.Key.ActivityID,
Column1 =g.Sum(p => p.Quantity),
Column2 = g.Sum(p => p.Amount)
}
abovetable is nothing but which is ur first table
abovetable:
SCHEID ACTIVITYID PID Quantity Amount
2 12 100 200 2000
2 12 101 300 2500
2 15 102 400 1400
2 15 103 120 2000