New Posts New Posts RSS Feed: Code first PostgreSql
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Code first PostgreSql

 Post Reply Post Reply
Author
Thomas View Drop Down
Newbie
Newbie
Avatar

Joined: 21-Feb-2012
Posts: 23
Post Options Post Options   Quote Thomas Quote  Post ReplyReply Direct Link To This Post Topic: Code first PostgreSql
    Posted: 04-Mar-2012 at 6:34am
I tried to use your model first WPF tutorial application and when i changed the connection string to 

<add name="CodeFirstWalk" connectionString="User Id=postgres;Host=localhost;Database=postgres;Persist Security Info=True;Schema='&quot;ETERADEV&quot;'" providerName="Devart.Data.PostgreSql" />

I got 

An error occurred during metadata generation and a metadata file could not be created.  Error: Keyword not supported: 'host'. G:\Program Files (x86)\MSBuild\IdeaBlade\IdeaBlade.DevForce.Common.targets 110 5


If you want to try it out just install the Devart PostgreSql provider and change the string.


Edited by Thomas - 04-Mar-2012 at 6:35am
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 05-Mar-2012 at 5:10pm
Hi Thomas,
 
I'm confused. Are you using ModelFirst or CodeFirst?
 
When you create an edmx based on an existing PostgreSql DB, what does the connectionSting look like?
 
Regards,
   Silvio.
Back to Top
Thomas View Drop Down
Newbie
Newbie
Avatar

Joined: 21-Feb-2012
Posts: 23
Post Options Post Options   Quote Thomas Quote  Post ReplyReply Direct Link To This Post Posted: 05-Mar-2012 at 9:50pm
Connection string for model first:

connectionString="metadata=res://*/model.EBModel.csdl|res://*/model.EBModel.ssdl|res://*/model.EBModel.msl;provider=Devart.Data.PostgreSql;provider connection string=&quot;User Id=postgres;Host=localhost;Database=postgres;Persist Security Info=True;Schema='&quot;&quot;ETERADEV&quot;&quot;'&quot;" providerName="System.Data.EntityClient"

And when I get the error I am using CodeFirst (ModelFirst is working).

I get the error when I compile the solution with an included .CF file (as I said, you can try it if you modify the demo WPF CodeFirst to use the devart provider instead of SqlServer)


Edited by Thomas - 05-Mar-2012 at 9:52pm
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 07-Mar-2012 at 2:02pm
Hi Thomas,
 
You will need to set the DefaultConnectionFactory. We talk about this topic in the DevForce Resource Center.
 
Be sure to also write an implementation of IDbConnectionFactory. (as shown in the link above)
 
Regards,
   Silvio.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down