I am going to create an application form with a UUID as its unique key (and not the primary key).
I got an error:
An exception of type "System.Data.Entity.Core.EntityCommandExecutionException" occurred in EntityFramework.SqlServer.dll, but was not processed in the user code Additional information: An error occurred while executing the command definition. See Internal Exception for more details.
Database Connection String:
connectionString="Data Source=(localdb)\v11.0; Initial Catalog=FormsContext; Integrated Security=True; MultipleActiveResultSets=True; AttachDbFilename=|DataDirectory|Forms.mdf" providerName="System.Data.SqlClient"
FormsContext.cs:
namespace ApplicationForm.Models { public class FormsContext : DbContext { public FormsContext() : base("name=FormsContext") { } public System.Data.Entity.DbSet<ApplicationForm.Models.Form> Forms { get; set; } ...
The database looks like this:
FormsContext->Forms->{id,uuid,first,last...}
I'm not sure what happened this time. Anyone help me get through this?
Edit / Resolution
I was not sure how to check the Inner Exception, and I did some research on this. So when I read the error message in the internal exception, I could solve my problem.
I found out what this error is. The query field is "firstname", but the column name of the table is "first". They did not match. As soon as I changed the name of the DB column, it worked again.
source share