Note that there are some explanatory texts on larger screens.

plurals
  1. PODbGeography.PointFromText 24141: A number is expected at position
    text
    copied!<p>I have WCF REST service which contains following code</p> <pre><code>var geo = DbGeography.PointFromText(string.Format("POINT({0} {1})", longitude, latitude), DbGeography.DefaultCoordinateSystemId); </code></pre> <p><strong>Unit test works fine</strong>, but when I call this code from client or HTTP debuder providing any values of latitude and longitude exept zeros, it fails with exception:</p> <pre><code>"24141: A number is expected at position X of the input. The input has ,XXXXXX." at Microsoft.SqlServer.Types.WellKnownTextReader.RecognizeDouble() at Microsoft.SqlServer.Types.WellKnownTextReader.ParsePointText(Boolean parseParentheses) 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.STPointFromText(SqlChars pointTaggedText, Int32 srid) </code></pre> <p>latitude and longitute for example<br> lat:37.58336895 long:-122.40549454<br> lat:37.38931302 long:-122.16207476</p> <p>I used Microsoft.SqlServer.Types referenced from SQLServer installation directory and SqlGeography.Point for working with spartial data on code side. Now I want to use EF 5 features directly without using reference to Microsoft.SqlServer.Types. It fails with and without this reference.</p> <p>Any idea what is wrong?</p> <p>.NET 4.5 installed, SQL Server version is Microsoft SQL Server 2008 (SP3) - 10.0.5500.0 (Intel X86) Sep 22 2011 00:28:06 Copyright (c) 1988-2008 Microsoft Corporation Standard Edition on Windows NT 6.1 (Build 7601: Service Pack 1)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload