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

Alternate to use for Mssql

Topics: SharpMap v2.0
Mar 11, 2010 at 6:33 PM


I am new to using SharpMap. We used SharpMap v1 and now updating our systems to SharpMap v2. We used SharpMap.Data.Providers.MsSql to retrieve data but this is not available in SharpMap v2 and I cannot use MsSqlSpatial as the data is not in spatial format. So I would like to know if there is any alternative or in any way I can use the MsSql Data Provider.


Mar 11, 2010 at 7:49 PM

Hello MHV,

what prevents you from using spatial capabilities of sqlserver 2008, after all, there is a free express version available that can handle spatial data?
You might consider MsSqlSpatial extension for SqlServer 2005 if that is not an option for you. As far as I know there is no provider that does not
require spatial capabilities for the datasources.

Hth FObermaier


Mar 11, 2010 at 8:16 PM

Hi MHV, if you can use sql 2008 it would be trivial to add geometry columns. You can run an alter statement on your table to add the geometry column then run an update to create the geometries. It might look like:

ADD COLUMN Geom geometry


SET Geom = geometry::Point(XColumn, YColumn, 4326 /*srid of the data*/)

hth jd

Mar 11, 2010 at 8:24 PM

Hello Fobermaier,

Cannot use sqlserver 2008 as all our systems use sqlserver 2005. Also I was wrong in saying that we are not using spatial data as our data is in shape files in the Well Known Binary Format. Also the problem is that I cannot use extensions. Is there any way I can take data from sql server 2005 in the WKB Format and convert it to spatial data and then process it as an input for layer providers.



Mar 12, 2010 at 5:03 PM

Hello Everyone,

I have many shape files.... So is there anyone who has written a code to convert these shapefiles to MSSQL Server 2008 Spatial data format?


Mar 12, 2010 at 5:34 PM

Hi MHV , you could try the Demo.FormatConverter project in the v2 source tree.. Make sure you build the solution a couple of times before running it as it needs to copy binaries after the first build.

Also Morten has a tool at 


hth jd

Mar 15, 2010 at 2:34 PM

Hey JD,

Thankyou. This worked for me.