i’ve the following table
+-------+--------+----------+
| catid | name | quantity |
+-------+--------+----------+
| 1 | table | 10 |
| 2 | chair | 5 |
| 2 | chair | 10 |
| 1 | table | 10 |
| 2 | chair | 15 |
| 3 | pencil | 20 |
+-------+--------+----------+
using LINQ i want to sum the quanitiy for the rows that have the same name catid and save this to the same datatable
so the result would be this table
+-------+--------+----------+
| catid | name | quantity |
+-------+--------+----------+
| 1 | table | 20 |
| 2 | chair | 30 |
| 3 | pencil | 20 |
+-------+--------+----------+
Edit: just noticed it’s VB tagged. Sorry for that. Well, should be something like this: