{“Cannot convert value”} error while save geometry data to postgresql table

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
omurbilgili
Posts: 1
Joined: Wed 17 Jan 2018 06:59

{“Cannot convert value”} error while save geometry data to postgresql table

Post by omurbilgili » Wed 17 Jan 2018 07:02

I want to add a record to postgresql table with DevArt dotConnect for PostgreSQL component. I use Entity Framework 6 and I add a kind of NuGet packages to my project. SharpMap, NetTopologySuite,GeoAPI...etc common geographic libraries for .net. But i get an error while saving data. Error is {"Cannot convert value"}. I can not solve this problem.

Code: Select all

using (var db = new MAKSDBDEVEntities())
        {
            var ilce = new MaksIlce()
            {
                Adi = "test",
                Guid = "hede",
                IlkKayitIp = "127.0.0.1",
                IlkKayitTarihi = DateTime.Now,
                IlkKayitKullaniciId = 0,
                UlkeGID = 1,
                Geom = DbGeometry.PointFromText("POINT(10 20)", 4326)
            };
            db.MaksIlces.AddObject(ilce);
            db.SaveChanges();
        }

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: {“Cannot convert value”} error while save geometry data to postgresql table

Post by Shalex » Wed 17 Jan 2018 15:04

Please refer to
viewtopic.php?t=30686
viewtopic.php?f=30&t=27655
http://blog.devart.com/enhanced-entity- ... resql.html

Be aware that starting from v7.5.639 Entity Framework-related assemblies are renamed and versioning changed (viewtopic.php?f=3&t=33573):
Devart.Data.PostgreSql.Entity.dll (7.5.639.6)
->
Devart.Data.PostgreSql.Entity.EF6.dll (7.5.639.0)

If this information doesn't help, please send us a small test project with the corresponding DDL/DML script.

Post Reply