值包含太多小数位。最大值为 0。Lightswitch html 客户端

Value contains too many decimal places. The maximum is 0. Lightswitch html client

我在 sql 中有 Decimal(5,2) 类型的列。在 LightSwitch 中,数据类型是 Decimal

如果我将 8.50 存储在 sql 的字段中,HTMLClient 将其显示为 8.5 并在更新实体时给出客户端验证错误:

The value 8.5 contains too many decimal places. The maximum is 0.

请提出修复建议。

尝试使用 Format Pattern 属性,您可以指定数字和日期类型在 Visual Studio LightSwitch 中创建的应用程序中的显示方式。
另外也许 this 文章会对您有所帮助。

感谢@MegaTron 为我指明了正确的方向。
事实证明,Decimal(Precision,Scale) 被错误地映射到 (5,0)。当我更新我的数据源时,它映射为 (5,2) 解决了这个问题。