What is the SQL (MS SQL Server) Decimal
equivalent in .NET?
Should it be Double
, Decimal
or Float
(Single
in VB.NET)?
There's no exact equivalent type in .NET, as SQL's decimal type is fixed point, whereas .NET's System.Decimal
type is a floating (decimal) point type.
However, System.Decimal
is definitely the closest match, and should generally be what's used to represent the value stored in a decimal column in a SQL database.
Use Decimal
, as can be seen in this table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With