ENTITY truncating decimal value when doing SELECT

Asked

Viewed 100 times

2

I have the following situation,

When executing a query using LINQ, I get the following return 5178560,00 but if I run the same query, directly in SQL SERVER, it returns me 5179975,00.

It’s not a display problem... it already brings me it from the bank that way, before even effecting some operation with the field.

How to proceed, to bring this value, in the pure form of the bank?

  • I think there is something wrong with your interpretation of things. If the decimal places have some value, they are shown correctly?

  • It is a list of decimal values, composed of 123 items, none of the items has broken value.. when executing the same query directly in SQL server, a value is returned, when executing the same query by LINQ, it makes this value change when bringing the data.

  • 1

    You could share the SQL and C# code you are using?

  • The following code is: http://pastebin.com/RvuHGShG The data list : http://pastebin.com/BfUizwfh

  • @Thiagosantos It would be good if you edit one of the data with the broken value to test.

  • Try using in the database, Decimal (7,2) in the value field.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.