jonpryor / dblinq2007

Automatically exported from code.google.com/p/dblinq2007
0 stars 0 forks source link

SubmitChanges with PostGres causes System.InvalidCastException on Mono 2.6.3 #266

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
new Npgsql.NpgsqlConnection(); //Without this line, NpgsqlConnection is not 
found in the next line...
DataContext db=new 
DbLinq.Data.Linq.DataContext("DbLinqProvider=PostgreSql;DbLinqConnectionType=Npg
sql.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 

Original issue reported on code.google.com by Beiri2...@gmail.com on 26 Jul 2010 at 10:53

GoogleCodeExporter commented 9 years ago
to old version of npgsql, sorry

Original comment by Beiri2...@gmail.com on 31 Jul 2010 at 11:02

GoogleCodeExporter commented 9 years ago
Closed as per Comment #1: Npgsql client was too old.

Original comment by jonmpr...@gmail.com on 2 Aug 2010 at 8:24

GoogleCodeExporter commented 9 years ago
Same issue HERE, but with Postgresql 9.0, npgsql 2.0.11

Original comment by Marco.Fr...@googlemail.com on 22 Jan 2011 at 9:51

GoogleCodeExporter commented 9 years ago
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).

Original comment by cedxbelin on 7 Dec 2011 at 4:16

GoogleCodeExporter commented 9 years ago
Problem solved! The assembly provided by Mono is broken. If you use the 
assembly downloaded from the Npgsql site, the InvalidCastException doesn't 
occur.

Original comment by cedxbelin on 8 Dec 2011 at 3:14