PostgreSQL via subsonic

淺唱寂寞╮ 提交于 2019-12-11 00:29:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!