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.
Else
Use linq method to check the value is exists or not.
Regards,
Arivu:-)
@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
Regards,
Dominic
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
Regards,
Mahesh
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.