How to compare variable with data in extarct table using linq

Hello,

i have value “kmathkar” in variable $user.
i am seraching with mail id in webpage and extracting table data.
you can see kmathkar in username column and in extact data preview as well it is showing.
so i need to cehck if username column contains “kmathkar” (value of variable $user) or not so based on this my next conditions will execute.
in column username mail id is aslo there in next line.
so please give me linq query so i can check and validate this

help me on same.

Hello @Mathkar_kunal,

Try this expression:

(From row In dt.AsEnumerable()
 Where row("Username").ToString.Trim.Contains(user)
 Select row).Any()

This returns True / False.

Thanks,
Karthik

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.