Friday, October 15, 2010

Filter Rows from DataTable Using Filter


public static DataTable FilterRows(DataTable source)
{ string root = parentID;
DataTable result = source.Clone();
string filter = "CategoryID = '" + root + "'";
DataRow[] rows = source.Select(filter);
foreach (DataRow row in rows)
{
result.ImportRow(row);
}
return result;
}

Share:

0 Comments:

Post a Comment