Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

split a datatable based on number of rows

 List<DataTable> result = DTHead.AsEnumerable()
            .GroupBy(row => row.Field<int>("MIVID"))
            .Select(g => g.CopyToDataTable())
            .ToList();
Comment

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();
Comment

PREVIOUS NEXT
Code Example
Csharp :: access form in a folder C# 
Csharp :: c# write to registry hkey_current_user 
Csharp :: two question marks c# 
Csharp :: asp.net Read raw Body 
Csharp :: regex ip rage detect 
Csharp :: c# extend array 
Csharp :: unity slider decimal 0.01 
Csharp :: asp.net framework mvc cors error axios 
Csharp :: itext7 c# memorystream 
Csharp :: c# ulong 
Csharp :: c sharp tenery operator with callin gmethods 
Csharp :: properties vs field c# 
Csharp :: c# convert string to datetime any format 
Csharp :: c# show hidden window wpf 
Csharp :: replace update claims c# 
Csharp :: trigger checkbox combobox wpf 
Csharp :: how to unit test dbcontext in .net core 
Csharp :: ASP.NET Core set update clear cache from IMemoryCache (set by Set method of CacheExtensions class) 
Csharp :: filter collection viewbag 
Csharp :: C# create delegate type at runtime 
Csharp :: pyqt single instance 
Csharp :: c# webbrowser control append 
Csharp :: nunit return parameter 
Csharp :: how to play a random sound at the position that you want in unity 
Csharp :: c# force arguments to be keywords 
Csharp :: c# null coalescing operator 
Csharp :: c# convert string to datetime 
Csharp :: swagger skip endpoint .net core 
Csharp :: transform face player unity 
Csharp :: .Net 6 Program.cs 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =