This should work fine. The Linq skip method should run very fast. I suppose this will probably depend on how much content you have DataRows, but with 3 columns, I got almost instant calls:
DataTable table = TwentyKRows();
for (int i = 0; i < 4; i++)
{
DateTime before = DateTime.Now;
var test = table.AsEnumerable().Skip(5000 * i).Take(5000);
DateTime after = DateTime.Now;
TimeSpan ts = after - before;
Console.WriteLine(ts.ToString());
}
Output:
00:00:00.0099991
00:00:00
00:00:00
00:00:00
source
share