Where can i find dt.select(filterexpression) help document

hi
i want to know how to write the filterexpression.of dt.select(“filterexpression”)
for example, i want to find out all the rows in a datatable that column(1) meet some complex expression.

i write the statement like: DT2=DT.select(“Column[1] Equals (expression)”).copytodatabale()

but make a error .

who can help to correct my statement?

@chlosh

via the official reference: https://docs.microsoft.com/en-us/dotnet/api/system.data.datatable.select?view=netcore-3.1
you will be routed to: https://www.csharp-examples.net/dataview-rowfilter/
some more functionalities can be found by common goolge researches

with your given info

  • we cannot refer to e.g. the value of expression
  • we cannot analyse the reported error

check following:

  • notice the typo in copytodatabale() has to be CopyToDataTable
  • use the column name instead
1 Like

ok,thanks your instant replay.And the link you given is very helpful.I will carefully read the document later。And i put more detail about my problem,if you can point out my mistake and correct it,it would be great and appreciate your help.My excel like this
image
and i just want to find out all the rows that the row(“due date”) is over 60 days. and wirte all this row to another datatable.

in the For each row activity,i use the below express to check .
DateTime.Today - DateTime.Parse(row(“due date”).ToString).Days > 60

So how i can add this conditions to the filterexpression?
dt2=dt1.select("???").copytodatatable

Or i can use another day to achieve it don’t need to use dt.selcet().
Because i am a green hand,so hope can answer more detail,or give a example attachment.thanks.

For working with dates in Select Expression have a look here:

I would suggest just setup a seperate xaml with build datatable and sample values and do al ot of plays to get familiar with the expression syntax.

From technical side another approach to do filtering is the use of LINQ