How to search for specific string without using column name in whole excel sheet


Search for a specific string in excel sheet without mentioning column name.


Hi @MahalingPatil,

Use Output data table to get a string value and can check the string. Contains method.
Use linq method to check the value is exists or not.



@MahalingPatil, Use this query, to get it as a Boolean, (whether that string exists or not)

Boolean b = (From row in datatable.Select() Where String.Join("", row.ItemArray()).Contains(string) Select row).ToArray().Count > 0

Dominic :slight_smile:


@Dominic, @MahalingPatil

you can also try like this. no need to use join

Boolean b = (From row in datatable.Select() Where row.ItemArray().Contaains(string) Select row).ToArray().Count > 0



Thank you…its working for me


Convert output of excel to Output data table. And simply use “Contains” method.

if(Readable_Data.Contains(“text to compare”))
It will return true or false.