English 中文(简体)
实体工作不成体系,是否接近于ger化。
原标题:Does Entity Framwork round off decimal value to nearest integer?

I m 采用实体框架和2008年MSQ服务器。 实体框架似乎总是将实体归结为最接近的愤怒,而这种愤怒实际上已经消失。 你们是否看到这个问题,以及你的解决办法是什么? 感谢!

最佳回答

i 属于同一问题。 我正在使用EFS和服务器2008 SP1。 我使用储存的程序来查询一些数据。 另一个令人痛心的事情是,如果我为一项储存的程序设定功能进口,欧洲航天局就向背景类别提供一种称为这种间谍的职能,但对我而言,它不是。 因此,我发挥自己的作用,叫间谍。 在这项职能中,我通过供应DBType建立了实体参数。 页: 1 但是,这一结果使精确度和比额表设定为0。 当我根据我的行文表要求(3和1个左右)确定正确数字时,一切都是ok。

zsolt

问题回答

没有你提供测绘课程和数据库图象 我只能假设,其中之一,你会重新使用一只印章或一片定点为零的精度。

还值得一提的是,你重新使用了哪一种“欧洲框架”。

问题没有答案。

与蒂莫西人所说的类似,它很可能出现以下一种情况:

  • A property of one of your generated classes is defined as an int while the column is a decimal - you can do this by changing the actual type in the entity designer
  • Somewhere in your code, you re working with ints rather than decimals. In particular, if you re using implicit typing using var, the compiler could be inferring an integral type rather than a decimal type

澄清第二点的一个例子:

var myNumber = 100;    // myNumber will be an int

myNumber = myNumber / 3;    // myNumber == 33 (an int)

你们能否把某些法典赋予我们一个更好的想法?

页: 1

页: 1

回答(而不是四舍五入)的语句,这样,如果你想要准确,你就必须将变数翻一番或折中。





相关问题
Performance impact of indexed view in MS SQL Server 2008

Does anyone have experience with using indexed view in MS SQL Server 2008? I am trying to find out how does indexed view affect performance of insert / update statements, that are adding / updating ...

Lock Escalation - What s happening here?

While altering a table (removing a column) in SQL Server 2008, I clicked the Generate Change Script button and I noticed that the change script it generated drops the column, says "go" and then runs ...

Round to nearest 5 in SQL Server

I have a Money column in my SQL Server 2008 table. In my below query how can I round it to nearest 5$ select FineAmount from tickets Thanks

热门标签