Hi guys,
I am having problem to filter data table based on 2 values.
For example, i am trying to filter a data table with values between 89.9 to 110.
I already trying to use filter data table activity but it returns no row.
Anyone have any idea to solve this one?
Yoichi
(Yoichi)
2
Hi,
If there is only numeric data in the target column, the following will work.
filteredDt = dt.AsEnumerable.Where(Function(r) Double.Parse(r("Columnname").ToString)>89.9 AndAlso Double.Parse(r("Columnname").ToString)<110).CopyToDataTable()
If there is non-numeric data including blank, we need to modify the above expression.
Regards,
Thanks man for the reply.
I receive this error:
The source contains no data rows.
Any thought to fix this error?
Yoichi
(Yoichi)
4
Hi,
The source contains no data rows.
This mean there is no row which matches the condition.
To avoid this error, can you try as the following?
arrayDataRow = dt.AsEnumerable.Where(Function(r) Double.Parse(r("Columnname").ToString)>89.9 AndAlso Double.Parse(r("Columnname").ToString)<110).ToArray()
Hope this helps you.
Regards,
system
(system)
Closed
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.