New issue 266 by Beiri22Ny: SubmitChanges with PostGres causes
System.InvalidCastException on Mono 2.6.3
http://code.google.com/p/dblinq2007/issues/detail?id=266
new Npgsql.NpgsqlConnection(); //Without this line, NpgsqlConnection is not
found in the next line...
DataContext db=new
DbLinq.Data.Linq.DataContext("DbLinqProvider=PostgreSql;DbLinqConnectionType=Npgsql.NpgsqlConnection,Npgsql;Server=localhost;Database=...;User
ID=...;Password=...;");
db.Log=Console.Out;
db.SubmitChanges();
=>
Unhandled Exception: System.InvalidCastException: Cannot cast from source
type to destination type.
at DbLinq.Data.Linq.DataContext.SubmitChanges (ConflictMode failureMode)
[0x00045] in
/home/rico/Desktop/dblinq/dblinq2007-read-only/src/DbLinq/Data/Linq/DataContext.cs:405
at DbLinq.Data.Linq.DataContext.SubmitChanges () [0x00000] in
/home/rico/Desktop/dblinq/dblinq2007-read-only/src/DbLinq/Data/Linq/DataContext.cs:368
at testlinq.MainClass.Main (System.String[] args) [0x00171] in
/home/rico/Projects/testlinq/testlinq/Main.cs:36
to old version of npgsql, sorry
Comment #2 on issue 266 by jonmpryor: SubmitChanges with PostGres causes
System.InvalidCastException on Mono 2.6.3
http://code.google.com/p/dblinq2007/issues/detail?id=266
Closed as per Comment #1: Npgsql client was too old.
Same issue HERE, but with Postgresql 9.0, npgsql 2.0.11
Same issue :(
Using Mac OS X 10.7.2, Mono 2.10.6, PostgreSQL 9.1 and Npgsql 4.0 (the
assembly provided by Mono, which is a customized version of 2.0.11.91).
Problem solved! The assembly provided by Mono is broken. If you use the
assembly downloaded from the Npgsql site, the InvalidCastException doesn't
occur.