博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
.NET EntityFrameworkCore.DbUpdateException 错误
阅读量:4561 次
发布时间:2019-06-08

本文共 2036 字,大约阅读时间需要 6 分钟。

Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: String or binary data would be truncated.The statement has been terminated.   at System.Data.SqlClient.SqlCommand.<>c.
b__122_0(Task`1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)--- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)--- End of stack trace from previous location where exception was thrown --- at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) --- End of inner exception stack trace --- at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(DbContext _, ValueTuple`2 parameters, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IReadOnlyList`1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesA...

原来是数据库中的某个字段长度问题、导致数据无法导入

转载于:https://www.cnblogs.com/w2011/p/9371957.html

你可能感兴趣的文章
LeetCode Maximum Subarray
查看>>
让我们再聊聊浏览器资源加载优化
查看>>
underscore demo
查看>>
CSS hack
查看>>
C# Enum Name String Description之间的相互转换
查看>>
PHP wamp server问题
查看>>
Spring Data Redis学习
查看>>
js闭包理解案例-解决for循环为元素注册事件的问题
查看>>
2015.04.23,外语,读书笔记-《Word Power Made Easy》 12 “如何奉承朋友” SESSION 33
查看>>
Spring+SpringMVC+JDBC实现登录
查看>>
生与死之间
查看>>
NEFU 109
查看>>
HDU 5435
查看>>
git从已有分支拉新分支开发
查看>>
滚动条隐藏兼容写法
查看>>
SQL2005查询所有表的大小
查看>>
Shell 正则表达式
查看>>
Docker run命令参数整理
查看>>
qt-opencv配置mingw编译器
查看>>
CSS之Medial Queries的另一用法:实现IE hack的方法
查看>>