/// <summary> /// 从一个表中获取从第N条后的count条数据 /// </summary> /// <param name="tb">原表</param> /// <param name="star">开始</param> /// <param name="count">共多少</param> /// <returns></returns> public DataTable GetTablesData(DataTable tb, int star, int count) { DataTable table1 = new DataTable(); for (int i = 0; i < tb.Columns.Count; i++) { table1.Columns.Add(tb.Columns[i].ColumnName); } if (tb.Rows.Count > 0) { for (int i = star; i < (star + count); i++) { if (i > tb.Rows.Count) { break; } table1.ImportRow(tb.Rows[i - 1]); } } return table1; }