This project has moved and is read-only. For the latest updates, please go here.

SQL 2005 with ESRI SDE

Topics: Data Access, SharpMap Project, SharpMap v0.9 / v1.x, Web Controls
Jan 26, 2009 at 2:28 PM

Please can someone help me. I am trying to load a shape file from a SQL 2005/sde database. In MapObjects I would connect in the following way.
Can anyone give me the correct code to access the shape file in this way.

Jan 26, 2009 at 2:36 PM
AFAIK there are no SharpMap providers for SDE, you would have to first export the data from sde to a shapefile. hth jd
Jan 26, 2009 at 3:25 PM
OK Thanks, I thought I had seen that somewhere before. I can access it as a shape file, but want to access it on the database. If it is on an SQL 2005 database shouldn't I be able to use MSSqlSpatial - I have tried this and get the following error
Invalid Object Name ST.AsBinary
Invalid Object Name ST.EnvelopQueryWhere

This is the code that I use to connect
Dim dsRoads As New SharpMap.Data.Providers.MsSqlSpatial("Server=;Database=dbasename;User ID=user;Password=pwd;", "Roads", "Shape", "OBJECTID")

Am I supposed to be adding something to SQL Server 2005? or to my database?

Jan 26, 2009 at 3:56 PM
Edited Jan 26, 2009 at 3:56 PM
MsSqlSpatial relies on a set of installed db clr-components/ schema. The schema is very unlikely to be compatible with sde out of the box. To install MsSqlSpatial run msscmd from the console project in the MsSqlSpatial source tree. You will then need to load the data from shapefiles again using msscmd. hth jd