Click here to Skip to main content
16,022,309 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I would like to implement an access account using email (with verification) including a reset password but most of the samples are using SQL server.

What I have tried:

Is there other mechanism or component which is DB agnostic (I'm currently using Postgresql)? A sample project is very much appreciated. Thank you.
Posted
Comments
[no name] 30-Jun-24 14:09pm    
The problem should be the same whichever database you use. The only difference being the exact syntax of the database commands.
Dave Kreskowiak 1-Jul-24 9:57am    
You could always use SQL Server Express. It's free.


IMHO, writing anything that depends on Access is going to bite you in the ass with the next Office update.

With Entity Framework, all that you need to do is swap the libs using Nuget, change the connection string, then run the commands to crate the database and tables.

Here is a Google Search with many examples of how to do this: entity framework postgresql tutorial[^]
 
Share this answer
 
Comments
sirch fsarso 5-Jul-24 20:57pm    
Thank you Graeme_Grant, i'll try these recommendations and get back on the results
As this is such a common thing to do, and so easy to do, I'll write out the steps to follow here:
  1. Uninstall the Microsoft.EntityFrameworkCore.SqlServer package. You're not going to need this one.
  2. Install the Npgsql.EntityFrameworkCore.PostgreSQL package.
  3. Install the Npgsql package.
  4. Update your application.json file to provide a PostgresSQL connection string instead of a SQL Server one.
  5. In Program.cs, change options.UseSqlServer to options.UseNpgsql in the AddDbContext operation.
  6. Delete the existing migrations
  7. Run dotnet ef migrations add CreateIdentity to create your new migrations.
  8. Run dotnet ef database update to create the tables inside Postgres.
You can now run your application and create users/log in as needed.
 
Share this answer
 
Comments
sirch fsarso 5-Jul-24 20:58pm    
Thank you sir Pete, i'll try these recommendations and get back on the results

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900