{“Cannot convert value”} error while save geometry data to postgresql table
Posted: 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();
}