How to use variables in datatable.select

Hello,

I have two csv files (csvA and csvB). and trying to retrieve the row from csvA which column1 contains value listed in csvB.
I’m sturgling with datatable.select. I want to use variables in select comparison but it couldn’t understand variables.
Just wondering how to fix the syntacs?
question

Thank you.
KN

You can use in this way:

dtalluser.Select("[Column1] = ‘" +Convert.ToString(targetempid) +"’")

2 Likes

Thanks Palindrome, it works perfectly for me! Thank you very much!

Welcome :slight_smile:

i have a Doubt If column1 Contains alphanumeric values that what datatype should i Convert to

you should still convert to string. Strings support alphanumeric values without complaint (and .Select expects a string to compare against anyway.