© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
2 replies
Bobby Bob

Entity Framework SQL Error 19 - Foreign Key Constraint Failed

I've described the problem in significant detail here: https://stackoverflow.com/questions/74162855/entity-framework-sql-error-19-foreign-key-constraint-failed

Not sure why I am getting the error I am getting. If you guys want to replicate the error, you should change the connection string
Data Source = 
Data Source = 
to your respective path of where the database
CoffeeShop.db
CoffeeShop.db
is in
Stack Overflow
Entity Framework SQL Error 19: 'Foreign KEY constraint failed'
Github Repo: https://github.com/blueboy90780/Coffee-POS-System/tree/master
I have small console application using .NET 6 and EF Core 6.0 with an SQLite database. When running my code I get the foll...
Entity Framework SQL Error 19: 'Foreign KEY constraint failed'
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Entity Framework Foreign Key
C#CC# / help
2y ago
Foreign Key | Entity Framework
C#CC# / help
2y ago
Entity Framework Core 8 -Foreign Key Constraint failure.
C#CC# / help
2y ago
Entity Framework Foreign Key restraint
C#CC# / help
16mo ago