LINQ query instead of Foreach

I would like to use LINQ query instead of foreach. But the syntax is not correct.

This works:
For Each Row in Data Table
row(“ColomnName”) = double.parse(row(“ColomnName”).ToString.Replace(“,”,“.”)).ToString

But not this one:

dt.AsEnumerable.Where(Function(r) double.parse(r(“ColomnName”).ToString.Replace(“,”,“.”)).ToString).CopyToDatatable()

Getting this error:
If Option Strict On is used, conversion from ‘String’ to ‘Boolean’ cannot be performed.

Any suggestions.


the reason why the booelan is mandatory needed for the where lambda is explained here:

Options for updating a data column value are discussed here:

Thanks for your response.

I will find a solution.

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