且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

循环将数据集分成多个表

更新时间:2023-02-27 10:32:28

YourDataTable.Select()

给您一个Datarows数组.
如果您按以下方式使用LINQ;

gives you an array of Datarows.
If you use LINQ as below;

myDataTable.Select(x => x).Take(100).ToEnumerable();


给您前100个DataRows和


gives you the first 100 DataRows and

myDataTable.Select(x => x).Skip(100).Take(100).ToEnumerable();


接下来的100个.

希望这会有所帮助:)

Jas


for the next 100.

Hope this helps :)

Jas


好,奇怪的问题.分享的信息不多.

由于您询问如何将数据集分为16个表,因此需要循环16次才能从数据集中获取92536条记录.获取它们并将它们存储在单独的表中.
Well, weird question. Not much of an info shared.

Since you asked on how to break a dataset into 16 tables, you would need to loop 16 times to get 92536 records from the dataset. Get them and store them in a separate table.
for(int i=0; i<16 ; i++)
{ 
  // Create a datatable here: table[i]
  for(int j=0; j<92536; j++)
   {
      //Get data for row number [i*92536+j] of large dataset
      // insert these data in the table[i]
   }
}



试试吧!



Try!