问题
I try to work with my postgres DB via SubSonic. I have simple config:
<configuration>
<connectionStrings>
<add name="test"
connectionString="Server=localhost;Port=5432;User Id=iliy;Password=111;Database=test;"
providerName="Npgsql"/>
</connectionStrings>
</configuration>
But it does not work. I got "Unable to find the requested .Net Framework Data Provider. It may not be installed." There is Npgsql reference in project.
What's wrong?
回答1:
I think you need to dig a little deeper into Subsonic for it to work with Postgres, because it does not know about any data provider for the database. It comes with providers for MS Sql Server, MySql, SqlLite etc.
回答2:
Did you add
<add name="Npgsql Data Provider" invariant="Npgsql" description=".Net Framework Data Provider for PostgreSQL Server" type="Npgsql.NpgsqlFactory, Npgsql, Version=2.0.6.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7"/>
to <DbProviderFactories>
in C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
?
"Unable to find the requested .Net Framework Data Provider. It may not be installed." Is not Subsonic exception.
来源:https://stackoverflow.com/questions/1149459/postgresql-via-subsonic