VDS Technologies

 

Add a Spatial Database (SQL Server Database)

8/16/2013 5:42:16 AM
Total Posts 4

Add a Spatial Database (SQL Server Database)

i got an error when i try Add a Spacial Database:

System.Exception: Non-binary spatial field specified

 

this is My script :

 

AspMap.Data.WkbDataLayer wkbDataLayer = new WkbDataLayer("System.Data.SqlClient", connectionString, "City", "geom");
wkbDataLayer.FieldList = "ID, City";
wkbDataLayer.ShapeType = ShapeType.MultiPoint;
wkbDataLayer.Extent = new AspMap.Rectangle(-180, 90, 180, -90); // decimal degrees
wkbDataLayer.CoordinateSystem = CoordSystem.WGS1984;

AspMap.Layer layer = map.AddLayer(wkbDataLayer);

// labels
layer.ShowLabels = true;
layer.LabelField = "City";
layer.LabelStyle = LabelStyle.PolygonCenter;
layer.LabelFont.Name = "Verdana";
layer.LabelFont.Size = 14;
layer.LabelFont.Outline = true;

// line size and color
layer.Symbol.Size = 1;
layer.Symbol.LineColor = Color.LightGray;

// fill color
layer.Symbol.FillColor = Color.Khaki;

 

 

the type of geom field is geometry

 

 

 

8/17/2013 3:16:56 AM
MVP
Total Posts 323

Re: Add a Spatial Database (SQL Server Database)

Use the SqlServerLayer class.