Puting variable in expression

I need to use an expression for filtering Datatable. But in that expression, I would like to use variables.

Here is my expression:

(From p In dt.Select Where p(5).ToString.Equals(filtered_array(0).ToString) Or p(5).ToString.Equals(filtered_array(1).ToString) Select p).CopyToDataTable

I need to use variables because I need to build this expression based on an array, and I don’t know what is the length of an array. So I have in mind to build part of expressions based on an array and save it to variable

main_query = p(5).ToString.Equals(filtered_array(0).ToString) Or p(5).ToString.Equals(filtered_array(1).ToString)

And then filter datatable in Assign:
new_filtered_dt = (From p In dt.Select Where “+main_query.ToString+” Select p).CopyToDataTable

But when I tried to do that I got an error

error

Please, can somebody help me? Thanks!

Buddy @mkriznjak keep that main_query variable as boolean datatype and pass just as main_query alone not with ToString…because the reason is where condition meets only a boolean outcome…but you expressed as string…thats why showing error like cannot convert from string to boolean

Cheers

Okay @Palaniyappan but how can I assign

main_query = p(5).ToString.Equals(filtered_array(0).ToString) Or p(5).ToString.Equals(filtered_array(1).ToString)

If main_query is boolean?

(From p In dt.Select Where “+main_query+” Select p).CopyToDataTable

I get that, but I still have a problem with this
error1

error2