code first with dotconnect for postgres
Posted: Mon 07 Oct 2013 10:51
In my C# Application, I am using code first to generate Postgres Database. SO, I dowloaded Devart DotConnect for postgress and i added devart.data.Postgres, devart.data and devart.data.Postgres.entity dlls to my references. Then, I added those lines in my app.config
When I execute my code I have this error
An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct
Code: Select all
<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 for PostgreSQL" invariant="Devart.Data.PostgreSql" description="Devart dotConnect for PostgreSQL" type="Devart.Data.PostgreSql.PgSqlProviderFactory, Devart.Data.PostgreSql, Version= 6.8.333.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</DbProviderFactories>
</system.data>
</configuration>
An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct