I’m currently evaluating Map Suite 3.0 for use on a ASP.Net web app and I looking to load all of the objects and layers from a SQL 2008 database. I was looking through the forums for some more in-depth samples since the ones that came with the evaluation don’t seam to connect to my database. I can’t seem to find any so I am hoping you may be able to point me in the right direction. I was also wondering if there may be some more detailed instructions on configuring and pulling a basic shape from as SQL 2008 DB. I found one example ( Post titled : MsSql2008FeatureLayer / using SQL server 2008 to store shape file data). I used the tool to convert the States.shp file into the DB but the evaluation example doesn’t appear to do anything with it.
here is a snippet of the evaluation code that I tried tweaking.
private void LoadAMapFromMsSQL2008()
{
string connectString = "User ID=userid;Password=password;Data Source=MySQL2008DB;";
MsSql2008FeatureLayer sql2008Layer = new MsSql2008FeatureLayer(connectString, "states", "recid");
sql2008Layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
sql2008Layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Map1.StaticOverlay.Layers.Add("Sql2008Layer", sql2008Layer);
}
I have setup the user account etc and it appears to connect with no error but page doesn’t look any different. I even turned off the shape file to see if maybe it was hiding the layer.
The desired shape for my test would be a basic X,Y grid where I could plot specific points within a polygon shape. For instance if I create a shape that looks like a square using an X,Y grid I could dynamically plot points in different areas of the square. Kind of like a splatter point graph.
Your help is greatly appreciated.
Many Thanks
Sam