I wanna use SqlGeography for its benefits in sql server 2016 and I have Visual Studio 2017 while using servicestack 4.5.14 and ormlite.
First and foremost I want to have SqlGeography as data type for my locations but it generates many exception as picture.
If I use DbGeography , when I am using servicestack and ormlite as follow:
Db.Insert(location);
It makes an exception as :
System.Data.SqlClient.SqlException: 'A .NET Framework error occurred
during execution of user-defined routine or aggregate "geography":
System.FormatException: 24114: The label {Geography:{Coordina in the
input well-known text (WKT) is not valid. Valid labels are POINT,
LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON,
GEOMETRYCOLLECTION, CIRCULARSTRING, COMPOUNDCURVE, CURVEPOLYGON and
FULLGLOBE (geography Data Type only).
System.FormatException:
at Microsoft.SqlServer.Types.OpenGisTypes.ParseLabel(String input)
at
Microsoft.SqlServer.Types.WellKnownTextReader.ParseTaggedText
(OpenGisType type)
at Microsoft.SqlServer.Types.WellKnownTextReader.Read(OpenGisType
type, Int32 srid)
at Microsoft.SqlServer.Types.SqlGeography.ParseText(OpenGisType type,
SqlChars taggedText, Int32 srid)
at
Microsoft.SqlServer.Types.SqlGeography.GeographyFromText(OpenGisType
type, SqlChars taggedText, Int32 srid)
at Microsoft.SqlServer.Types.SqlGeography.Parse(SqlString s)
.
The statement has been terminated.'