Column count

How to get the count of the number of rows in a particular column in a datatable?

My datatable has 4 columns Text, Assignment, comment, rules.
I would require the number of rows under the column Assignment alone. Any approach on this?

In a datatable, the number of rows is the same for all columns, and can be fetched using DtData.Rows.Count, where DtData is your datatable.

If you intend to count how many values in that column are not blank, then you can get this with DtData.Select("'Assignment' <> '').Count, where the column contains strings.

1 Like