How to fix this error using Linq Query

I have Data table consist of 3 columns

Company Value Status
Apple -0.25
Microsoft 2.12
Google -1.01
Robert Bosch -0.77
Tesla 1.58
GM 1.3
Walmart -0.05
UiPath -2.08
JP Morgan 4.68
Bank of America 4.9

I need to update status if value>0 it is increased otherwise decreased.

Please help with these error. How to fix this problem.

Main.xaml: Cannot assign from type ‘System.Data.EnumerableRowCollection`1[System.Data.DataRow]’ to type ‘System.Data.DataTable’ in Assign activity ‘Assign’.

hi @Sai.Srinivas

Use “(” before from and check once

No, it not worked. is there any other way.

Error: Main.xaml: Cannot assign from type ‘System.Data.EnumerableRowCollection`1[System.Data.DataRow]’ to type ‘System.Data.DataTable’ in Assign activity ‘Assign’.

Can you send the sample input and the code you have used?

Please find the attachments input and code files. Waiting for response.

Main.xaml (11.0 KB)
Status.xlsx (10.7 KB)

I would use standard for each row activity and assign in it, and said num = float(row.item(“column”)), than if activity and if num >0 → assign row.item("status)=“your status”

Hi @Sai.Srinivas

Checkout your updated xaml and output file
Main.xaml (10.2 KB)
Status.xlsx (10.4 KB)


1 Like

Thank you. it is worked

1 Like

@Sudharsan_Ka Why we need to use ( before From Statement.Please tell me this

Thank you for code.

You need to open the bracket when you close it at last

1 Like

@Sudharsan_Ka Yes i got it. i forgot it when writing the code. thanks

Kindly open a new topic will discuss this aspect there

@Sudharsan_Ka Please check this new topic.

Thank you in advance.

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