我得到以下异常,而试图通过的EntityFramework参数值“163753323027.987000000”超出范围
InnerException: An error occurred while updating the entries. See the inner exception for details.
InnerException -> InnerException: Parameter value '163753323027.987000000' is out of range.
我试图提供的所有解决方案,以节省分贝值。但仍然无法解决问题。我正在使用EntityFramework,SQL Server。这不是代码优先。
在我的表我有一列
ActualHydPressureDropPipe decimal(30, 10)
的应用价值正试图在数据库存储为163753323027.987000000
我不能尝试在这里here提供,因为我DONOT有EntityTypeConfiguration类的答案。
我想答案给here
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Mud_Volumes>().Property(x => x.ActualHydPressureDropPipe).HasPrecision(30, 10);
base.OnModelCreating(modelBuilder);
}
这不是工作要么。我不知道为什么控制器没有进入上述方法。可能是因为这不是第一个代码。
我在EDMX检查我有
<Property Type="Decimal" Name="ActualHydPressureDropPipe" Nullable="false" Precision="30" Scale="10" />
请指点。
尝试只是163753323027,也许这会告诉你一些事情的原因。 – toddmo 2014-11-22 06:39:48