I’m getting an error when I pass a C# double into a SQL Server float parameter. I know I’m sending in a value that the SQL Server float can’t represent, but I can’t figure out which one it is. So, my question is what values can a C# double represent that a SQL Server float can’t?
Share
IIRC the values NaN, PositiveInfinity and NegativeInfinity are not supported by SQL Server. You could check for this with the methods Double.IsNaN(…) and Double.IsInfinity(…).
Don’t use
==for checking, as these special values are never equal to any other value, not even themselves (e.g.NaN != NaN).