Filter DataTable with special characters

Hi all,
I am trying to filter a DataTable, but an issue appear in my way.
The entries in the column has two special characters " ’ ’ " and " / "

image

This is how i made the code to filter

and this is the problem

:frowning: apparently the “/” is the most problem here, or i don’t know. please help me.
Thank you!!

One solution could be to use a replace first. So replace (“'”,“”). Then filter.
Or even better. Use dt_Informe.Select(“Progresivo=”(asterisk)+RMA.toString+(asterisk)"). Wildcard could solve the problem.

Insert asterisk sign “*” instead of (asterisk) an

3 Likes

Hi,
You may try LINQ expression instead of Select method.
An example can be found here: Cannot perform 'Like' operation on System.DateTime and System.String - #2 by reda

Cheers

2 Likes

Use the Filter Data Table activity.

hi Julian, @Julian have you solved this problem? I m facing the similar problem. if you don’t mind, please kindly share the solution.
Thanks

Hi @Willow, To solve my problem i used this.

dt_Informe.Select(" Progresivo=’ ’ " +progresivo+ " ’ ’ ")

Thanks for your reply. I tried this but it still does not work. and I used other way to solve my issue .
as Zheng.Tang shared, i used the Filter Data Table activity. :grinning:

Hello Team,
I am facing the similar issue while trying to filter the special characters and empty strings using DataTable. I am using the below expressions

  1. “Include Prod Select”.ToString.Trim.ToUpper.Replace(“-”,“”) = “N-NO”.Replace(“-”,“”)


    The above expressions doesn’t throw any errors but its retreives count of 0 even if there are matching rows

  2. “Amt of Co-Pay”.ToString = " "
    “Amt of Co-Pay”.ToString Is Empty

The above operation should check for empty string/Null and retrieve the count.

Appreciate if anyone could help to resolve this issue