I cannot use '<>' operator on System.Double and System.String

Hello,

I need help, please. I have an issue with an Assign activity.

I have an Excel file, one column with rows.
Some rows has values, other not. I need to create a newDT with only the rows with values.

For that I do the following steps

1/ Read Rang activity (output Datatable : Dt_List)
2/ Assign activity : new argument : out_Dt_List, (type : Datatable), so
out_Dt_List = Dt_ListeFinale.Select("[ListeFinale] <> ’ ’ ").CopyToDataTable
3/ Message box to count the number of rows : out_Dt_List.Rows.Count.ToString

When I run the WorkFlow, I have an error :
“Assign: Cannot perform a ‘<>’ operation on System.Double and System.String.”

I am stuck here ! Please help really appreciate.

Thank you the community

Hi @najoua.abbaci :wave:

Why don’t you use a Filter Data Table activity to filter the column that doesn’t contain a '?

If you still want to use Select() then make use of the below link:

@najoua.abbaci
as a short starter help, give a try on:

Getting all rows where column ListeFinale is not blank
Dt_ListeFinale.AsEnumerable.Where(Function ( r ) Not String.IsNullOrEmpty(r(“ListeFinale”).toString.Trim)).CopyToDataTable

Getting all rows where column ListeFinale is blank
Dt_ListeFinale.AsEnumerable.Where(Function ( r ) String.IsNullOrEmpty(r(“ListeFinale”).toString.Trim)).CopyToDataTable

1 Like

Thank you for your answer.
I check already this page and I followed it. But for the Filter Data Table, I don’t know why it doesn’t work too. It couldn’t recognise my column :confused:

Wouah, it works ! Thank you very much ! Regards!

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