How to get second Column row count from datatable

Hello Everyone,

I need to get the second Column row count from the datatable(dt).

Is there any code like dt.rows.count for second column row or any other way to achieve this.


hi @raghuramk
Kindly try this Linq query in assign activity !!
DtTable.Rows.Cast(Of DataRow)().Where(Function(row) Not row.Item(“ColName”) IsNot DBNull.Value Or row.Item(“ColName”).ToString() <> “”).Count
The above code will ignore the empty rows, and ll consider only the rows with the data!

Thanks !!

1 Like