Quote:Unable to cast object of type 'System.Data.DataRow[]' to type 'System.Data.DataTable'
Dim _New_dt As New DataTable() Dim dtArr() As DataTable = Nothing Dim Columns As DataRow = dt.NewRow _New_dt = dt.Copy _New_dt.Columns.Add("Key_Id", GetType(String)) Dim c = _New_dt.Rows.Count / 30000 Dim SheetNumber = Convert.ToInt64(System.Math.Ceiling(c)) For j As Integer = 0 To c dtArr(j) = _New_dt.Select("Key_Id <= 1 And Key_Id >= 30000").Clone() dtArr(j) = _New_dt.Select("Key_Id <= 31000 And Key_Id >= 60000").Clone() dtArr(j) = _New_dt.Select("Key_Id <= 61000 And Key_Id >= 90000").Clone() dtArr(j) = _New_dt.Select("Key_Id <= 91000 And Key_Id >= 120000").Clone() dtArr(j) = _New_dt.Select("Key_Id <= 121000 And Key_Id >= 150000").Clone() Next
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)