I’m having a couple of issues while trying to count the number of times a keyword shows in a data table.
Initially, I’m looping through a datatable to get the initial count - that works fine. Using the same dt, I’d like to count the number of times a keyword shows within a specific column.
(The column name has been defined within the ‘Get row item’ read from an excel doc)
I’ve tried to set this condition within an if statement:
(Convert.ToString(row.Item(“Column Name”)) = “My Keyword”=True)
Then attempt to get the count of those rows which meet that condition however, I receive this error: Object reference not set to an instance of an object.
I’ve also tried a select statement, but again I’m receiving errors. Can someone point out if I’m missing something / a simpler way to achieve this?