Linq Query condition

Hi All,

I have used a Linq Query to Filter Data Table

x(“ns_order_status”).ToString.Equals(“NULL”) AND x(“mismatched_column”).ToString.Equals(“0”)

It should select only if mismatched_column =0 but strangely in two of the cases it selected the value when the mismatched_column was equal to 1. Is that possible?

Does query fails ?

image

@dutta.marina,

Try converting mismatched column value into integer or double then match.

For example: Cint(x(“ns_order_status”).ToString) = 0 like that you try once.

@dutta.marina

x("mismatched_column").Equals(0) // if it's numeric
x("ns_order_status").ToString().Trim().Equals("NULL", StringComparison.OrdinalIgnoreCase)

Give the expression as

CurrentRow("X").Equals(0) AndAlso CurrentRow("ns_order_status").ToString().Trim().Equals("NULL", StringComparison.OrdinalIgnoreCase)

Hope this will help you