I'm attempting to connect to a PostgreSQL database from my ASP.NET MVC site. The format for the view and model work for both SQL Server and MySQL, so I shouldn't have problems there, as far as I can tell.
The application is throwing a System.ArgumentException in the System.Data.dll and returns an error:
Keyword not supported: metadata" "Parameter name: keyword
on the webpage.
That it is using the System.Data.dll seems wrong, but I can't corroborate this.
How can I connect to PostgreSQL in this manner?
I have Nuget installed Npgsql 3.0.5 and EntityFramework6.Npgsql 3.0.5.
Please let me know if I left off vital information.
Relevant web.config information is as follows:
<add name="PostgreSQLConnectionString"
connectionString="
metadata=res://*/Models.Test.csdl|res://*/Models.Test.ssdl|res://*/Models.Test.msl;
provider=System.Data.SqlClient;
provider connection string="
data source=localhost:5432\;
initial catalog=Test;
integrated security=False;
user id=username;
password=password;
multipleactiveresultsets=True;
App=EntityFramework""
providerName="Npgsql" />
<provider invariantName="Npgsql"
type="Npgsql.NpgsqlServices, EntityFramework6.Npgsql">
</provider>
<remove invariant="Npgsql" />
<add name="Npgsql - .Net Data Provider for PostgreSQL"
invariant="Npgsql"
description=".Net Data Provider for PostgreSQL"
type="Npgsql.NpgsqlFactory, Npgsql, Version=3.0.5.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
Npgsql, notSystem.Data.SqlClient, and I'm not sure the Postgres driver supports MARS. Here's an example of a Code-first configuration.