Filter DataTable using C# Linq

Dear All,

I am not able to filter DataTable using C# Linq.

DT:
image

Linq Query: dt_Users.AsEnumerable().Where(row => row.Field(“Salary”).Contains(“USD”)).CopyToDataTable()

Error in Studio:

Hi,

For now, can you try to save the project, close Studio and reopen the project? Automatic recovery feature might run.

Regards,

I have also created new project for test and have tried to do the same. Still the same error.

Br,
NikZ

@Nikhil_Zambare1,

  1. Close the Studio
  2. Take a backup of your projects project.json file
  3. Delete the project.json from project
  4. Open the project by double clicking on Main.xaml from File Explorer.
  5. UiPath Studio should rebuild the project.json will all require packages restored.
  6. Recheck the code.

Thanks,
Ashok :slight_smile:

Dear Ashok,

Thanx for your time.
I have tried as you directed. The issue is still there.

Br,
NikZ

@Nikhil_Zambare1,

What’s the source of the datatable is it from Read Range or Build Datatable?

Dear Ashok,

I am using excel read range activity.
I also have imported system.linq namespace.

@Nikhil_Zambare1,

Try importing System.Xml.ReaderWriter Or System.Xml

@Nikhil_Zambare1

Also try this.

1 Like

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