I’m trying to execute below linq query on a datatable.
(from row in InwardDT.AsEnumerable() where row.Field(of Integer)(“Income”) > 4000 select row).CopyToDataTable. It throws me the below error
“Assign: Specified cast is not valid.” . However, the same query works when I make use of string field
(from row in InwardDT.AsEnumerable() where row.Field(of String)(“City”) = “Mumbai” select row).CopyToDataTable. -> Works as expected.
Any kind of assistance would be of great help…
Thank you in advance.