Filter DataTable with multiple conditions



So far all the guide and post I see online only has a single condition like dt.Select("[ColumnX]=‘Test’"). Is there a way to filter out the dataTable with 2 conditions, for example, dt.Select("[ColumnX]<>‘Test’") and dt.Select("[ColumnX]<>‘Sample’"). I have tried it out personally and I can’t seem to get it working.


Try this:
dt.Select("[ColumnX]<>‘Test’ and [ColumnX]<>‘Sample’")


@poogy112, To make it more simpler use this dt.Select("[ColumnX] Not in (‘Test’,‘Sample’)"). You can add multiple conditions here.

Dominic :slight_smile:


Concise and better syntax than my suggestion, thanks!:grinning:


I need to filter the Data table with multiple filter values/arguments ,

I tried below syntax, but getting error .Please let me know any one.

I’m uploading some images for references(Actually I need to filter more than 5 values )