Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jssg33 opened this issue Jan 1, 2025 · 1 comment
Open

Comments

@jssg33
Copy link

jssg33 commented Jan 1, 2025

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.

@bubibubi
Copy link
Owner

bubibubi commented Jan 7, 2025

You can enable a debug on console settings JetConnection.ShowSqlStatement to true. You can then see the query that does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants