Try this, it will count the number of lines containing "Y" or "N" inside Column-A:
int count = dataTable.AsEnumerable()
.Count(row => row.Field<string>("Column-A") == "Y"
|| row.Field<string>("Column-A") == "N");
I think this is what you are trying to do? If I misunderstood your question, please let me know.
Donut source
share