5

Database table:

,[Location] GEOGRAPHY

Update Location with EF using SRID 104001

item.Location = System.Data.Entity.Spatial.DbGeography.PointFromText($"Point({loc.Lng} {loc.Lat})", 104001);

Exception:

24204: The spatial reference identifier (SRID) is not valid. The specified SRID must match one of the supported SRIDs displayed in the sys.spatial_reference_systems catalog view.

Database check:

SELECT * FROM sys.spatial_reference_systems WHERE spatial_reference_id = 104001

104001  Microsoft   104001  GEOGCS["Unit Sphere", DATUM["Unit Sphere", SPHEROID["Sphere", 1.0, 0.0]], PRIMEM["Greenwich",0.0], UNIT["Degree", 0.0174532925199433]]  radian  1

Using:

.Net Framework 4.6.1;
Entity Framework 6.1.3;
Microsoft SQL Server 2014 (SP2-GDR) (KB3194714) - 12.0.5203.0 (X64)   Sep 23 2016 18:13:56   Copyright (c) Microsoft Corporation  Standard Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) ;
Database Compatibility level 120
Raymond
  • 2,276
  • 2
  • 20
  • 34
D. Traykov
  • 51
  • 3
  • Tested with Microsoft SQL Server 2016 (SP1-GDR) (KB3207512) - 13.0.4199.0 (X64) Enterprise Edition and i keep getting the same error. – D. Traykov Feb 23 '17 at 12:46

0 Answers0