Friday, October 15, 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

AJAX, asp, Asp.net, asp.net and sql server security, Asp.net IntemIndex, C#, Css, DataBinder.Eval, DataKeyNames, Datalist, Datapager, DataSet, DataTable, DropDownList, FindControl, gridview, JavaScript, jquery, Listview, Paging, Regex, RegularExpression, Repeater, Server side validation, Sql Server, timer, timercallback, Validation, XML, xmlnode, XPath