Issue with assign activity after updating to Windows Compatability

Hello, I recently updated a project to the new Windows Compatability (.Net Core), and I am now getting an error in my Assign activity. Any help would be appreciated.

Expression Used:
(From x In Dt_EmailNotification.AsEnumerable() Order By convert.Tostring(x(“Subsidiary”)),convert.ToString(x(“ExpirationDate”)) Select x).CopyToDataTable

Error:

Please try this

Dt_EmailNotification.AsEnumerable().OrderBy(function(x) x("Subsidiary").ToString).OrderBy(function(x) x("ExpirationDate").ToString).CopyToDataTable

And for the error try retyping by deleting it or use another assign and see…I don’t see an error on the code nor the code shows error in my studio

Hope this helps

Cheers

1 Like

ensure the right doublequotes needed: "

(From x In Dt_EmailNotification.AsEnumerable() 
Order By x("Subsidiary").ToString() ,x("ExpirationDate").ToString
Select x).CopyToDataTable

Keep in mind:

x("ExpirationDate").ToString

will cause a lexically ordering

When using the method syntax from LINQ we would use the ThenBy for second ordering
grafik

1 Like

Hello @Anil_G,

First, thank you for reviewing. Are you using Windows compatibility (.Net Core 6) or Windows Legacy (.Net Framework 4.6.xxx). It works when using Windows Legacy (.Net Framework), but when upgrading to Windows compatibility (.Net Core), it no longer works.

@PWilliams

Windows is what I am on …and it works…try upgrading packages and then as said retype the formula…the double quotes are different in windows legacy and windows…"(0x22) these are the correct ones…

Hope this helps

Cheers

1 Like

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