|
-
Apr 8th, 2014, 04:17 PM
#1
Thread Starter
Junior Member
LINQ Group and Sum
Hi, all masters.
I have a problem. I use below code;
Dim dt = New DataTable("tblEntTable")
...
...
dt.Columns.Add("ID", GetType(String))
dt.Columns.Add("Amount", GetType(Decimal))
dt.Rows.Add
.....
.....
Dim res = dt.AsEnumerable()
.OrderBy(Function(row) row.Field(Of String)("ID"))
.GroupBy(Function(row) row.Field(Of String)("ID"))
.[Select](Function(grp) grp.First())
dtgrdClone.DataSource = res.CopyToDataTable
Code is perfect run, but not SUM Amount Fields.
How to SUM "Ammunt" Fields.
Please Help
Kind Regards Gokhan
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|