I'm attempting to use an Access database from a WPF MVVM application using JetEntityFrameworkProvider and I can't get it to work. I've created the models, created the migrations using Add-Migration but when I run Update-Database, the command never finishes. It does create the database but the only table is MSysAccessStorage. There is a section of the documentation that says
In order to make the provider work, the table MSysRelationships should be accessible from Administrator
and further says
This is the default configuration so no needs to make changes. Access since version 2003 has visible system tables so no need to assign rights. The configuration must be done setting the right dual table (very early in your code).
JetConnection.DUAL = JetConnection.DUALForAccdb;
I've tried adding this but I can't figure out where "very early in your code" is. I've added it to the top of my App.xaml.cs and to my database context and neither worked. When I add it I get:
The name 'DUAL' does not exist in the current context. The name 'JetConnection.DUALForAccdb' does not exist in the current context.
This is my OnConfiguring in my context
protected override void OnConfiguring( DbContextOptionsBuilder optionsBuilder )
{
optionsBuilder.UseJet( @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\<User>\Desktop\New Folder\Staff.accdb;" );
}
What am I not doing correctly?