Contains not a member of String()

Hello

I converted my project from legacy to windows and I am getting an error that I did not have before the conversion.

Here is the expression: DT.AsEnumerable().Where(Function(r) peopleList.Contains(r.Field(Of String)(“Name”))).ToArray()

and here is the error message : “Contains is not a member of String()”

I don’t understand why it wouldn’t be available anymore ? It’s even on official documentation

Thank you

Hi @adext,

You could start troubleshooting using these threads to see if you can resolve it yourself

@adext
Check in imports:

Imports System.Linq

is available?

@adext

The source of the error is the variable peopleList which seems to be converted to a string instead of being a List.

What if you try : enforcing list type (peopleList.ToList)

DT.AsEnumerable().Where(Function(r) peopleList.ToList.Contains(r.Field(Of String)(“Name”))).ToArray()

no it was not
i added it and it worked! thank you :slight_smile:

1 Like

@adext Happy automation❤

1 Like

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