[Solved] I want to Split Datatable rows based on number [closed]
You could use following LINQ query: 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(); The array contains 6 tables, 5 with 12 rows, the last one has the remaining row. Checked with … Read more