-1

How do I query a typed datatable using linq to see it contains any number of the defined array.

string[] arInts = {1, 2, 3};

I wanted to query the table and find if it contains any number in array arInts

Mahmoud Gamal
  • 78,257
  • 17
  • 139
  • 164
CoolArchTek
  • 3,729
  • 12
  • 47
  • 76

1 Answers1

2

This looks like the question here:

Linq to Entities - SQL "IN" clause The following query should work:

var q = from t in tableName
               where arInts.Contains(t.fieldName)
               select t;
Community
  • 1
  • 1
Saher Ahwal
  • 9,015
  • 32
  • 84
  • 152