Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'd like to know if it was possible to extrapolate data from a table with more than 9 columns.
When i run the code with a table with 9 columns it works but with 10 or more it gaves me this error:
System.OutOfMemoryException: 'Thrown an exception of type 'System.OutOfMemoryException'
This is my code in C#:
if (objectsApp.Type.ToLower() == "table")
{
var o = application.GetGenericObject(objectsApp.Name);
var pager = o.GetAllHyperCubePagers().First();
var allPages = pager.IteratePages(new[] { new NxPage { Width = pager.NumberOfColumns, Height = 100 } }, Pager.Next).Select(pageSet => pageSet.Single());
try {
List<NxCellRows> pages = allPages.SelectMany(page => page.Matrix).ToList();
}
catch(Exception e)
{
Console.WriteLine("Error: "+e.Message);
}
}
The machine that runs it is an AWS machine with 32gb RAM and Xeon E5 2686 V4.
Thanks,
at the end the problem was that i was debugging on visual studio in 32 bit instead of 64 bit 🤣.
There are no limitations in the SDK regarding the number of columns. But how many rows does the table have? Since you are using "ToList" you will force all of those rows to be loaded into memory all at once, so if the table is very large, then that might cause memory problems.
For large tables, it's better to load the data lazily. And you might also be able to use the method "pager.GetAllData()" if that is what you're after:
Thanks,
at the end the problem was that i was debugging on visual studio in 32 bit instead of 64 bit 🤣.