c# - How to use DotConnect For PostgreSQL and entity framework code first -


i trying use postgresql database in project. learn code first developement.. download dotconnect postgresql (trial version) , added devart.data.postgresql dll references. then, added lines in app.copnfig

 <connectionstrings>         <add name="schooldbconnectionstring" connectionstring="server=localhost;port = 5432;database=mydatabase;user id=postgres;password=*****" providername="devart.data.postgresql" />     </connectionstrings> <system.data>      <dbproviderfactories>         <remove invariant="devart.data.postgresql" />         <add name="dotconnect postgresql" invariant="devart.data.postgresql" description="devart dotconnect postgresql" type="devart.data.postgresql.pgsqlproviderfactory, devart.data.postgresql, version= 6.8.333.0, culture=neutral, publickeytoken=09af7300eec23701" />     </dbproviderfactories>   </system.data> </configuration> 

when execute application have exeption :

an error occurred while getting provider information database. can caused entity framework using incorrect connection string. check inner exceptions details , ensure connection string correct.

try add (not tested)

<provider invariantname="devart.data.postgresql" type="devart.data.postgresql.entity.pgsqlentityproviderservices, devart.data.postgresql.entity, version=7.1.26.6, culture=neutral, publickeytoken=09af7300eec23701" /> 

and

<entityframework>     <providers>       <provider invariantname="devart.data.postgresql" type="devart.data.postgresql.entity.pgsqlentityproviderservices,       devart.data.postgresql.entity, version=7.1.26.6, culture=neutral, publickeytoken=09af7300eec23701" />     </providers> </entityframework> 

note: replace 7.1.26.6 actual assembly version.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -