Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
22 Points
54 Posts
May 21, 2012 11:36 AM|LINK
Hi
I have the following codes
var nolHistorySummary = dtGridDetails.AsEnumerable() .GroupBy(x => new { Id = x.Field<string>("Id") }) .Select(groupedTable => new { Id = groupedTable.Key.Id, Prev = groupedTable.Sum(s => Convert.ToDecimal(s.Field<string>(col1))), Adj = groupedTable.Sum(s => Convert.ToDecimal(s.Field<string>(col2))) });
now i need to assign the "nolHistorySummary " value to a list or datatable.how itsd possible
ajeesh.mekka...
Member
22 Points
54 Posts
How to assign Linq group by value to a List
May 21, 2012 11:36 AM|LINK
Hi
I have the following codes
var nolHistorySummary = dtGridDetails.AsEnumerable()
.GroupBy(x => new
{
Id = x.Field<string>("Id")
})
.Select(groupedTable => new
{
Id = groupedTable.Key.Id,
Prev = groupedTable.Sum(s => Convert.ToDecimal(s.Field<string>(col1))),
Adj = groupedTable.Sum(s => Convert.ToDecimal(s.Field<string>(col2)))
});
now i need to assign the "nolHistorySummary " value to a list or datatable.how itsd possible