4

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

1 Answer 1

7

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.