EF5, SQL Server, Longitude and Latitude

后端 未结 4 898
误落风尘
误落风尘 2021-02-13 17:57

I found that the best type to store lat and long in SQL Server is decimal (9,6) (ref. What datatype to use when storing latitude and longitude data in SQL databases?) and so I d

4条回答
  •  清酒与你
    2021-02-13 18:47

    Two things:

    1. I just purchased a Zip code database and it stores all latitude and longitude values as decimal(12,6) data type. I don't think this is going to radically change your results though.

    2. I would check the exact SQL being sent to your SQL Server. You can then check to see where the rounding is occurring. You can check the SQL being sent by grabbing the output from EF or using SQL Profiler. My guess is that it's occuring in your C# code.

    Also, it might be useful to see your table schema and your domain entity.

提交回复
热议问题