Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

split a datatable based on number of rows

DataTable[] splittedtables = tbl.AsEnumerable()
    .Select((row, index) => new { row, index })
    .GroupBy(x => x.index / 12)  // integer division, the fractional part is truncated
    .Select(g => g.Select(x => x.row).CopyToDataTable())
    .ToArray();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #split #datatable #based #number #rows
ADD COMMENT
Topic
Name
6+2 =