I have been looking at your example of using the MsSql2008FeatureLayer trying to get this layer to pull the country shapes that i have imported to my database. When I run it I get an error- "Object reference not set to an instance of an object." Before adding the layer i do a check to make sure that the layer has data in it. From what I can see the layer has all of the data except the geometry column.
sql2008Layer.Open();
Collection<feature> features = sql2008Layer.QueryTools.GetAllFeatures(ReturningColumnsType.AllColumns);
I can see all of the elements in the feature. I am using a tool found on the internet to import the data. This is the tool that I am using SqlSpatialTools. Any ideas on what I need to do so that I can get these features to show up? This is the code that I am using to set up the map.
string connectString = "Data Source=jcasper01;Initial Catalog=Atlas;Persist Security Info=True;Integrated Security=True;";
MsSql2008FeatureLayer sql2008Layer = new MsSql2008FeatureLayer(connectString, "Country", "ID");
sql2008Layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1; sql2008Layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
sql2008Layer.Open();
Collection<feature> features = sql2008Layer.QueryTools.GetAllFeatures(ReturningColumnsType.AllColumns);
Map1.StaticOverlay.Layers.Add("Sql2008Layer", sql2008Layer);