What specific values โ€‹โ€‹can C # double contain that the SQL Server plugin cannot?

I get an error when I pass C # double to the SQL Server float parameter. I know that I am sending a value that a floating SQL Server cannot represent, but I cannot figure out what it is. So my question is, what C # double values โ€‹โ€‹might represent that floating SQL Server can't?

+4
source share
3 answers

IIRC values NaN , PositiveInfinity and NegativeInfinity are not supported by SQL Server. You can verify this using the Double.IsNaN (...) and Double.IsInfinity (...) methods.

Do not use == to check, because these special values โ€‹โ€‹are never equal to any other value, not even themselves (for example, NaN != NaN ).

+3
source

The double and float parameters are the same data type. I think your mistake may be secondary to another problem. Perhaps your parameter did not pass correctly? Check the actual value of the parameter that is transmitted in the data stream.

0
source

Source: https://habr.com/ru/post/1333225/


All Articles