I have a datatable, dtFoo, and would like to get a count of the rows that meet a certain criteria.
EDIT: This data is not stored in a database, so using SQL is not an op
Not sure if this is faster, but at least it's shorter :)
int rows = new DataView(dtFoo, "IsActive = 'Y'", "IsActive", DataViewRowState.CurrentRows).Table.Rows.Count;
object count =dtFoo.Compute("count(IsActive)", "IsActive='Y'");