Have a DataTable and I need to create another one having a subset range of rows from the first. So I want the second DataTable to have row n till n + y from the first one. How can I do this please?
DataTable limitData = new DataTable();
for (int rowIndex = startingRow; rowIndex < endingRow; rowIndex++)
{
limitData.Rows.Add(columnarData.Rows[rowIndex].ItemArray);
}
gives an error: "Input array is longer than the number of columns in this table."
The code is in C# .NET 4.0