princesszea
Technical User
Hi,
Using the code below can someone please show me how to cache my query below.
Thanks
Using the code below can someone please show me how to cache my query below.
Code:
var query = from row in dt.AsEnumerable()
group row by row["name"] into grp
let totalcount = dt.AsEnumerable().Count()
select new
{
Id = grp.Key,
Count = grp.Count(),
TotalCount = totalcount,
Ratio = grp.Count() / totalcount
}
foreach (var grp in query)
{
int Count = grp.Count;
int TotalCount = grp.TotalCount;
int value = Count * 100 / TotalCount;
}