Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Additional information: No mapping exists from object type System.Data.Entity.Spatial.DbGeography to a known managed provider native type.
  2.  
  3. public class Position{...
  4. public DbGeography Coordinates { get; set; }
  5. ...
  6.  
  7. position.Coordinates = DbGeography.FromText(string.Format("POINT({0} {1})", _longitude, _latitude));
  8. ...
  9. cmd.CommandText = @"UPDATE Positions SET [Coordinates] = @Coordinates WHERE PositionId = 1";
  10. cmd.Parameters.Add(new SqlParameter("@Coordinates", store.Coordinates));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement