問題描述:
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: 將截斷字符串或二進制數據。 語句已終止。
解決方案:
出現這個問題,是因為字段的長度問題。比如我們給數據庫設置了一個字段 string path,設置它的長度為50個字符。如果我們設置的path的值超過了50個字符。那么就會出現這個錯誤。解決該問題需要擴大數據庫中path的長度。