how to sum different columns in a different rows in a dataset...i need to sum quantity .if these are in grid?
id product name date quantity
| 3 | pppppppp | 27-10-2014 5 |
| 4 | pppppppp 28-10-2014 6 |
| 3 | pppppppp | 27-10-2014 5 |
| 4 | pppppppp 28-10-2014 6 |
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Khan Abrar AhmedRank #778 · 3K reputationPosted Oct 28, 2014, 2:09 AM EDT
Hi try this var results = from row in lDTSalesOrder group row by row.Field("product name") into grp orderby grp.Key select new { id= grp.Key, Quantity = grp.Sum(r => r.Field("Quantity")) };