I am facing the below error while try to search the string in datatable.
Your condition seems to be wrong…
You should mention the column which you want to search for the value in your data table in the for each row loop if condition
Try this for the condition for your IF activity
row("YourColumnName").ToString.Contains("Automation and Robotics")
Replace “YourcolumnName” with your column name in your data table.
If this works for you… please mark the answer as the solution so that it could help others too…
There is no column name. So i just mention the column index but it doesn’t work.
PFA… i need to read the ‘output’ file. To check the first column and verify the string ‘Automation and Robotics’ whether it is match. if it is matches then i have to copy the corresponding url.
Why don’t apply like this.
I checked you xl. you can apply like this
row.Item(0) IsNot DBNull.Value AndAlso row.Item(0).ToString().Contains("Automation and Robotics")
`row(0).ToString.Contains("Automation and Robotics")`
I checked this syntax - ‘row.Item(0).ToString().Contains(“Automation and Robotics”)’
it seems like it is working. Will this work if there is any space in end/start of the string ?
And also can you please explain how to use this one - ‘row.Item(0) IsNot DBNull.Value’ with string match ?
First one you can check like this .
"row.Item(0).ToString().Trim().Contains("Automation and Robotics")"
For string you can check like this
"strValue IsNot Nothing"
Thanks a lot @balupad14 . It works well . Thank you so much.
Thanks to you too @Lahiru.Fernando for the suggestion.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.