What data type should I use to hold currency values in Entity Framework 6 and what data type should I map it in SQL Server 2012?
Thank You, Miguel
To have precise values, use decimal in C#, and also decimal(m, n) in SQL Server. float or double or real just aren't precise and will be susceptible to rounding errors - I'd avoid those.
See this other SO question (and its answers) for a discussion of money vs. decimal in SQL Server and why you should avoid money in SQL Server.
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