Even if you set ConvertNulls to false, the conversion is always performed in an expression. To check for null or DBNull, you need to use the following method:
Hello,
thanks, I'm understand. But my my question was, how can I return a DBNull-Value or a empty string (not -1 as in my Test) if the result of the expression is not defined so that my appended test works?
Comments
The correct expression is:
Report.I3] == 0 ? -1 : [Report.I2]/[Report.I3
Even if you set ConvertNulls to false, the conversion is always performed in an expression. To check for null or DBNull, you need to use the following method:
Report.GetColumnValueNullable("Report.I3") == null || Report.GetColumnValueNullable("Report.I3") == DBNull.Value
thanks, I'm understand. But my my question was, how can I return a DBNull-Value or a empty string (not -1 as in my Test) if the result of the expression is not defined so that my appended test works?
I've converted the result to (object) to make "?" operator working.