SQL 2005 with ESRI SDE

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

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.
"Server=SDE90:10.1.78.11;User=user;Password=pwd;instance=Port:5151;Database=sde"
Can anyone give me the correct code to access the shape file in this way.

Thanks
Coordinator
Jan 26, 2009 at 1: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 2: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=10.78.1.11;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?

Thanks
Coordinator
Jan 26, 2009 at 2:56 PM
Edited Jan 26, 2009 at 2: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