SharpMap and SQL 2008 with Data type Geometry

Topics: Español, SharpMap Project, WinForms Controls
Oct 20, 2009 at 8:54 PM

I'm using SharpMap and i want do a viewer of data types Geometric  from SQL Server 2008

My exemple code is:

SharpMap.Map myMap = new SharpMap.Map(new Size(500,450));

List<SharpMap.Geometries.Geometry> GeomColl = new List<SharpMap.Geometries.Geometry>();
GeomColl.Add(new SharpMap.Geometries.Point(10, 10));

...

myLayer.DataSource = new SharpMap.Data.Providers.GeometryProvider(GeomColl);
           
myMap.Layers.Add(myLayer);

 

But I want do this

******************************************************************

DataTable tabla = getDatos("Select col1 From Lakes");

SharpMap.Map myMap = new SharpMap.Map(new Size(500,450));

List<SharpMap.Geometries.Geometry> GeomColl = new List<SharpMap.Geometries.Geometry>();
GeomColl.Add(tabla.rows[0][0]);                                                                                                        ---------> How do I do????????

...

myLayer.DataSource = new SharpMap.Data.Providers.GeometryProvider(GeomColl);
           
myMap.Layers.Add(myLayer);

Coordinator
Oct 20, 2009 at 9:53 PM
Edited Oct 20, 2009 at 9:53 PM

Hi jessan, why not use a SqlServer2008 Provider? http://sharpmap.codeplex.com/SourceControl/changeset/view/60134#996329