how to connect postgresql with .NET MAUI - postgresql

I'm new in developing application using .NET MAUI.
Currently I need to have database to my project, but I don't know how to connect PostgreSQL to .NET MAUI. All tutorial I found more to SQLite.
Thank you

Related

.NET Core 2.1 and .NET Core 5.0 Web-Apps on Same Server

We currently have a production server running multiple .NET Core 2.1 websites and we need to deploy a website running .NET Core 5.0 on that same server.
I know I need to install dotnet-hosting-5.0.7-win.exe to be able to host the new site. Will installing that version of dotnet-hosting have any negative effects on the 2.1 sites?
I just want to make sure that running both versions is possible. Thank you.

Where is Entity Framework in Visual Studio 2017?

I've verified that Entity Framework 6 Tools is installed as suggested in other answers on this site, but ADO.NET Entity Data Model never shows up in the New Items/Data list. I've also tried installing the .NET CORE 2.0 SDK as other answers have suggested to no avail.
To be clear, I'm not creating a .NET CORE application, I'm just trying to make a class library based on .NET framework 4.6. I created the project via .NET Standard and selected Class Library (.NET Standard).
I just need to install EF so I can do a code first generation from my existing SQL Server DB.
Don't use .NET Standard, select a .NET Framework project type.
.NET Standard is an abstract "Core or Framework" option, as if the naming wasn't confusing enough.

Entity Framework Power Tools - cannot connect to Oracle

I have just installed Entity Framework Power Tools Beta 4 into Visual Studio 2013. I am running a .NET framework 4.5 project, using Entity Framework code first with an Oracle database. I have installed the latest ODP.NET from Oracle (version 12), including the EF drivers, and I have Oracle.ManagedDataAccess and Oracle.ManagedDataAccess.EntityFramework referenced in my project.
This set up allows me to run my project and read and access data from the Oracle database. It all works fine. My problem is when I try to use the Entity Framework Power Tools. I can specify a connection using the Oracle database name and credentials, and the dialog says 'Test Connection succeeded'. However, after clicking the next button, I get the following error:
System.Data.ProviderIncompatibleException: The store provider factory type 'System.Data.OracleClient.OracleClientFactory' does not implement the IServiceProvider interface. Use a store provider that implements this interface.
I am confused because my project is able to use the installed ODP.NET as is to communicate with the Oracle database via Entity Framework. Most of the research I have done on the WWW suggests there should be a problem with versions and the contents of the web.config - but if this is the case surely I wouldn't be able to use EF with Oracle in my project without errors?
Is it just the case that the Power Tools do not work with Oracle?
Cheers!
Martin
As Christian says in his comment, you need to install ODP.NET as a provider that Power Tools can use. I did this by installing Oracle Developer Tools for Visual Studio.

DOTNET CLI RC2 EF migrations

I just migrated to RC2 from RC1 and having a really hard time getting the ef commands and migrations to work.
I've read several other questions and have ran into the problem that's getting described in this link as a known issue.
The problem is that if I follow the instructions and create a brand new console application (.core) I'm still getting the following message:
This preview of Entity Framework tools does not support targeting class library projects in ASP.NET Core and .NET Core applications. See http://go.microsoft.com/fwlink/?LinkId=798221 for details and workarounds.
What am I doing wrong? Do I need to revert to rc1?
How did you do this migration ? I ask because in my case everything works time - as for now.
In my case I have removed all RC1 components first and then I have installed new RC2 components...
Next I have created new APS project using new Visual Studio Templates to get correct references and just moved my code to this new project.
Of course it's few things which I had to update in my code, but everything works fine for me including ef commands and migrations.
As you can read in ASP.NET Core installation guide
Before you start
Remove all previous versions of .NET Core from your system by using Add/Remove programs.
You need RC1 setup file to uninstall this component - if you do not have it, check StackOverflow - you can find link to download missing files.
Try follow the docs:
ASP.NET Migration
Migrating from ASP.NET 5 RC1 to ASP.NET
Core
Migrating from DNX to .NET Core CLI
ASP.NET 5 RC1 apps were based on the .NET Execution Environment (DNX)
and made use of DNX specific features. ASP.NET Core RC2 is based on
.NET Core, so you must first migrate your application to the new .NET
Core project model. See Migrating from DNX to .NET Core CLI for more
information.
Hope this help you :)

Does Npgsql support community version of postgres?

I read from the enterprise db website that only the Postgres standard server and advanced server support Npgsql.
But am not sure if
1. Npgsql will not work with community version at all ?? or
2. It is just that it is not packaged along with community version,but I can use npgsql to connect and work with postgresql from .Net
Can someone help me understand?
I read from the enterprise db website that only the Postgres standard
server and advanced server support Npgsql.
EnterpriseDB is not the same as PostgreSQL. PostgreSQL is PostgreSQL, it's not a "community version" from EnterpriseDB. EnterpriseDB Server is a fork of PostgreSQL, not the other way around.
And yes, Npgsql does work with PostgreSQL, it was created for PostgreSQL:
Npgsql is a .Net Data Provider for Postgresql. It allows any program
developed for .Net framework to access database server. It is
implemented in 100% C# code. Works with Postgresql 7.x and above.