Filter datatable using an array of values?
I have a datatable called dt which includes a column called type
I have a string array called typestringarray with about 15 members
I want to create a new datatable from the rows where type is a member of typestringarray
here's a simplified example of my problem:
dt
id type
1 red
2 blue
3 orange
4 green
5 pink
6 green
typestringarray = {"red", "blue", "green")
so my new table would be
id type
1 red
2 blue
4 green
6 green
I'm not sure how to start.
defaultview.rowfilter doesn't look right, as my filter would have 15 or more OR clauses.
There must be a really simple answer that I'm missing?
I'm using .NET Framework 3.5
I'm planning to be spontaneous tomorrow