Pages - Menu

Friday, 15 October 2010

Get record in specific range from DataTable

public static DataTable CopyTableRows(
DataTable source, int startIndex, int endIndex )
{
DataTable result = source.Clone();
for (int i = startIndex; i <= endIndex && i < source.Rows.Count; i++)
{
result.ImportRow( source.Rows[i] );
}
return result;
}

No comments:

Post a Comment