An error occurred while EF updated the entry. For more information, see inner exception.

Source: Internet
Author: User

phenomenon: When using EF to add records, the above exception has been reported, the net value is empty, the primary key outside the key is not set, etc., but the problem is still correct in these cases

resolution process: There is a sentence in the exception (see internal exception), has not been the case, and then there is no way to calm down to see, the content of the exception is as follows:

InnerException:System.Data.SqlClient.SqlException
hresult=-2146232060
Message=implicit conversion from the data type nvarchar to varbinary are not allowed. Use the CONVERT function to run this query.
The message table name cannot be converted from nvarchar to varbinary, and is then carefully reviewed in the database field set to varbinary (carelessness), and is intended to be set to varchar
To resolve a problem by changing the database field type to varchar

An error occurred while EF updated the entry. For more information, see inner exception.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.