This article is a mirror article of machine translation, please click here to jump to the original article.

View: 26346|Reply: 2

[Source] Verification fails for one or more entities. For more information...

[Copy link]
Posted on 2020-2-13 10:39:06 | | | |
Verification fails for one or more entities. For more information, see the EntityValidationErrors property.
Modifications:

Turn off the ValidateOnSaveEnabled switch before SaveChanges

You can turn it off like this at the Controller level


Or at the DAL layer, which is closed to the entire system

After closing, this error is not reported, and another error is reported instead:

SqlException (0x80131904): String or binary data will be truncated. The sentence has been terminated.

This is the problem, so to speak, when you are working with the database, there are fields that exceed the size limit of your fields in the database

Looking at the code, there are indeed fields that are too long.


Error causes:

1. Non-empty columns do not insert values incorrectly

2. The length of the foreign key column between multiple tables is different        

3. The ef context object db is empty         

4. EF context setting property to db. Configuration.ValidateOnSaveEnabled = false;

5. The content length exceeds the maximum column length


The reason for my error is that the name length size exceeds the limit.






Previous:The Baidu network disk link I posted is invalid,What should I do?
Next:.net core bootstrap-fileinputupload file
Posted on 2020-2-13 11:17:47 |
I would like to know what your motivation is, one person supporting a forum.
 Landlord| Posted on 2020-2-13 11:45:53 |
zncliving Posted on 2020-2-13 11:17
I would like to know what your motivation is, one person supporting a forum.

interest
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com