/// <summary>
/// 分割数据集
/// </summary>
/// <param name="dtData">数据集</param>
/// <param name="Number">分多少个</param>
/// <returns></returns>
private IList<DataTable> ListData(DataTable dtData, int Number)
{
List<DataTable> dtList = new List<DataTable>();
double meiye=Math.Ceiling(dtData.Rows.Count / (double)Number);
for (int i = 0; i < Math.Ceiling(dtData.Rows.Count / (double)meiye); i++)
{
DataTable subdt = new DataTable();
subdt = dtData.Clone();
dtData.AsEnumerable().Skip(Convert.ToInt32(meiye * i)).Take(Convert.ToInt32(meiye)).ToList().ForEach(name => subdt.ImportRow(name));
dtList.Add(subdt);
}
return dtList;
}
/// 分割数据集
/// </summary>
/// <param name="dtData">数据集</param>
/// <param name="Number">分多少个</param>
/// <returns></returns>
private IList<DataTable> ListData(DataTable dtData, int Number)
{
List<DataTable> dtList = new List<DataTable>();
double meiye=Math.Ceiling(dtData.Rows.Count / (double)Number);
for (int i = 0; i < Math.Ceiling(dtData.Rows.Count / (double)meiye); i++)
{
DataTable subdt = new DataTable();
subdt = dtData.Clone();
dtData.AsEnumerable().Skip(Convert.ToInt32(meiye * i)).Take(Convert.ToInt32(meiye)).ToList().ForEach(name => subdt.ImportRow(name));
dtList.Add(subdt);
}
return dtList;
}