I\'m engaged in a C# learning process and it is going well so far. I however just now hit my first \"say what?\" moment.
The DataTable offers random row access to it
Extension method based on Linq
public static void DeleteRows(this DataTable dt, Func predicate) { foreach (var row in dt.Rows.Cast().Where(predicate).ToList()) row.Delete(); }
Then use:
DataTable dt = GetSomeData(); dt.DeleteRows(r => r.Field("Amount") > 123.12 && r.Field("ABC") == "XYZ");