This is a migrated thread and some comments may be shown as answers.

postgresql error

2 Answers 120 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pawel Paluch
Top achievements
Rank 1
Pawel Paluch asked on 23 Jul 2011, 01:14 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Ady
Telerik team
answered on 26 Jul 2011, 03:45 PM
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!

0
Pawel Paluch
Top achievements
Rank 1
answered on 09 Aug 2011, 06:07 PM
Hello,
indeed that works, thank you for solution.

Best regards
Paweł
Tags
Databases and Data Types
Asked by
Pawel Paluch
Top achievements
Rank 1
Answers by
Ady
Telerik team
Pawel Paluch
Top achievements
Rank 1
Share this question
or