Issue in data filtering

I want to keep those records from a datatable where the length of a particular field (Additional Contact Mobile No) =10 or 8.
I want to keep only those records where length is either 10 or 8.
How can i do this?

Give a try on:
Assign activity
leftside: dtFiltered | DataType:DataTable
Right side:

(From d in YuurDataTableVar.AsEnumerable
let acmn = d(yourColNameOrIndex).toString.Trim
Where acmn.length = 8 Or acmn.length = 10
Select r=d).CopyToDataTable

handling empty filter result can be done with following patterns:


hi @ppr Thank you.
I want to learn linq query. Can you please tell me the best resources to learn about linq query.

Currently we are working on rolling out a tutorial series on learning LINQ. Have a look on the first tutorials here:

we suggest to start with learning the basics on List/Array base. With some more practice doing LINQ on datatables will be easier and more sucessfully.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.