Hi devs, please assist I am grouping using C# but on larger files the code fails and throws out of memory exception, how do we rewrite pls: Here’s the code
output = dt.AsEnumerable()
.GroupBy(dr => dr.Field(“NO”))
.Where(g => g.Count() < 2)
.SelectMany(g => g)
Console.WriteLine(“Debit Is Empty”);
Approx how many rows do you have?
How much memory do you have?
Divide the tasks.
it seems that SelectMany() and CopyToDataTable() function require lots memory.
First, get list distinct “NO” field,
then iterate, grouping, selectMany
finally append to table.
Hi Nithin Krishna, I have approximately 200000 rows
Okay what do you want to actually do - I mean if you show us the input and expected output.
Book1.xlsx (9.4 KB), the result returns the grouped values based on condition