question

AndrewHsiao-6094 avatar image
0 Votes"
AndrewHsiao-6094 asked karenpayneoregon answered

How to use Dotnet ef tool to create access tables class

Now,I had use the assemables with EntityframworkCore.Jet and EntityframeworkCore.Jet.Oledb are not be create the access tables classes by entityframeworkCore
use DotNet ef tool
the command is
dotnet ef dbcontext scaffold "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=123.accdb,OleDbFactory.Instance" DotNetFramworkCore.Jet --project windowsformsapp1

dotnet ef dbcontext scaffold "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=123.accdb,OleDbFactory.Instance" EntityframeworkCore.Jet.Oledb --project windowsformsapp1

dotnet ef dbcontext scaffold "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=123.accdb,OleDbFactory.Instance" System.Data.OleDB --project windowsformsapp1

do I build the entityframworkCore command ?

dotnet-entity-framework-core
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

karenpayneoregon avatar image
1 Vote"
karenpayneoregon answered

You can try my tool to scaffold your Access database which I wrote a while back for fun.

From the screenshot below it generated

 Scaffold-DbContext "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\OED\Dotnetland\ScaffoldDbContextHelper\AccessScaffoldDbContextHelper\bin\Debug\NorthWind.accdb" -Provider EntityFrameworkCore.Jet -OutputDir Models  -Context NorthContext  -v -f  -project Microsoft.Access.Data -startupproject Microsoft.Access.Data -ContextDir Contexts -t "Categories","Customers","CustomersContactTitle","Employees","Orders","Products","Suppliers","SuppliersContactTitle"


121501-accessreverse.png

121493-figure1.png



accessreverse.png (35.5 KiB)
figure1.png (6.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.