Hi Everyone ,
I hope you are doing well. I have a scenario. I think it’s a known one. If you can help me with the solution.
How to find out one text from the entire Datatable , Datatable is not having any column header.
Suppose the value is “Sourav”. Need to find it from a Datatable. We don’t know in which column this value would be available, and also we don’t have any column header name.
What would be the solution.
Lookup Data Table.
Convert output of excel to Output data table. And simply use “Contains” method.
It will return true or false.
to check if the value is present within the datatable in any row / any column we can do
strTerm = Sourav
hasTerm | Boolean =
yourDataTableVar.AsEnumerable.Any(Function (d) d.ItemArray.Any(Function (x) x.toString.toUpper.Contains(strTerm.toUpper)))
Thank you for the quick responce. I accept this solution, as this one gave me correct output also it is easiest and less time taking approach.
Thanks once again.
Thanks others also for the quick responce.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.