JetEntityFrameworkProvider icon indicating copy to clipboard operation
JetEntityFrameworkProvider copied to clipboard

Installed EntityFrameworkCore.Jet Get,Put,Delete Work but Cant Insert

Open jssg33 opened this issue 1 year ago • 1 comments

I installed your drivers with MSAccess default Student Database, and Used Entity Framework to Scaffold the Database. The Student Database has an attachment field, and an autoincrement ID field by default. Get, Delete, and Update Work...but adding a new record fails.

When I try to do an insert without an attach statement, I get an error of cannot insert into a multi-valued field. When I add the attach to the inserted data, it appears to work without an error but it doesnt save the data..... Example......

context.Students.Add(input); await context.SaveChangesAsync();

Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. ---> System.Data.OleDb.OleDbException (0x80004005): An INSERT INTO query cannot contain a multi-valued field.

context.Students.Add(input); context.Attach(input); await context.SaveChangesAsync();

Doesnt give an error but nothing is saved in the DB?

Help? This is a DB First Example.

jssg33 avatar Jan 01 '25 22:01 jssg33