Help with Linq expression

Hi, I am very new at this can anyone explain me in detail. I was using the linq expression:

(From row In dt Order By DateTime.ParseExact(row.Item(“Database date”).ToString, “dd MMMM yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture) Descending Select row).CopyToDataTable

But everytime I am having this error,

Compiler error(s) encountered processing expression “(From row In dt Order By DateTime.ParseExact(row.Item(“Database date”).ToString, “dd MMMM yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture) Descending Select row).CopyToDataTable”.
Expression of type ‘System.Data.DataTable’ is not queryable. Make sure you are not missing an assembly reference and/or namespace import for the LINQ provider

I have imported the namespace system.linq but dont know what I am doing wrong or whether I need to install the package.

Hi,

It seems same problem as the following post.
Can you try #2 post of the following?

Regards,

1 Like

Thank you. It worked. :smile:

1 Like

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