postgresql error

3 posts, 1 answers
  1. Pawel Paluch
    Pawel Paluch avatar
    10 posts
    Member since:
    Mar 2010

    Posted 23 Jul 2011 Link to this post

    Hello,
    aafter creating model for my app i faced a problem with connecting to postgresql.
    Fisrt i created model and generated database from it.
    Next i added domain service and trid to compile project and here the problem starts each time i get following error:

    Database driver installation problem: Cannot use factory for postgresql.
    Expected property 'Password' found on 'Npgsql.NpgsqlConnectionStringBuilder',
    but with wrong type 'System.Byte[]'.
    Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriverException: Database driver
    installation problem: Cannot use factory for postgresql. Expected property
    'Password' found on 'Npgsql.NpgsqlConnectionStringBuilder', but with wrong type
    'System.Byte[]'. ---> System.InvalidOperationException: Expected property
    'Password' found on 'Npgsql.NpgsqlConnectionStringBuilder', but with wrong type
    'System.Byte[]'.<BR>   at
    OpenAccessRuntime.ReflectionUtils.AssureInstanceProperty[T](Type t, String
    name)<BR>   at
    Telerik.OpenAccess.RT.Adonet2Generic.Impl.PostgreSqlFactory.AssureLoaded(DbProviderFactory
    tmp)<BR>   at
    Telerik.OpenAccess.RT.Adonet2Generic.Impl.PostgreSqlFactory..ctor(DbProviderFactory
    f)<BR>   at
    Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.GetFactoryByName(String
    backend)<BR>   at
    Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.GetFactory(ConnectionString
    cs, Boolean err)<BR>   --- End of inner exception stack trace
    ---<BR>   at
    Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.GetFactory(ConnectionString
    cs, Boolean err)<BR>   at
    Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.connect(ConnectionString
    connectionString, IDictionary driverProps)<BR>   at
    OpenAccessRuntime.Relational.sql.SqlDriver.InitializeFor(ConnectionString
    connectionString, Boolean noConnect, PropertySet props, Driver& driver,
    Connection& conn)<BR><BR>

    then i tried simple console application this time i generated model from existing postgres db and all went smooth until i tried following code:
    var mi = new Menu_item
                {
                    Lbel="Administracja",
                    Namespace="",
                    Package="",
                    Priority=500
                };
                var c = new EntitiesModel();
                c.Add(mi);
                c.SaveChanges();
    same as error as pasted above is throw at "c.Add(mi);"

    to mention originally i had Npgsql 2.0.11.91 but after some search and reading http://www.telerik.com/help/openaccess-orm/getting-started-root-dbsupport-postgresql.html
    i added Npgsql 2.0.10 as well but it was no help.
    What shall be done to make it running?

    Best regards
    Paweł Paluch
  2. Answer
    Ady
    Admin
    Ady avatar
    588 posts

    Posted 26 Jul 2011 Link to this post

    Hi Pawel Paluch,

     This is a problem with the latest version of the Npgsql driver - 2.0.11.91. This version introduced a breaking change where the type of the NpgsqlConnectionStringBuilder.Password property was changed from 'string' to 'Byte[]'. This has been fixed by the community and a newer version is available, although it still is a preview version.

    You can upgrade to this preview version or downgrade to version 2.0.10.0 .Ensure that you have only 1 version installed.

    This should solve the problem.

    Kind regards,
    Ady
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
  4. Pawel Paluch
    Pawel Paluch avatar
    10 posts
    Member since:
    Mar 2010

    Posted 09 Aug 2011 Link to this post

    Hello,
    indeed that works, thank you for solution.

    Best regards
    Paweł
Back to Top