Hello,
I have the following problem when i try to read a layer from a table i dont get anything and when i debug it this error occurs
if you use the CustomOverlays collection you may not at the same time use the following properties: BackgroundOverlay, StaticOverlay, DynamicOverlay or MarkerOverlay. CustomOverlays was designed to replace these so that you can implement as many overlays as you need in any order. Trying to use CustomerOverlays and one of the properties above is not allowed as there is not a definitive logical order we could draw them in
the thing is that i dont use CustomOverlay anywhere in my code.
private void LoadAMapFromMsSQL2008()
{
string connectString = "Server = ------; Database = -----; Trusted_Connection = True";
SqlConnection sqlConnection = new SqlConnection(connectString);
try
{
sqlConnection.Open();
SqlCommand sqlCommand = new SqlCommand("Select Count(*) from Odiko_Diktyo", sqlConnection);
int count = (int)sqlCommand.ExecuteScalar(); // I can read the table and the count is correct
MsSql2008FeatureLayer sql2008Layer = new MsSql2008FeatureLayer(connectString, "Odiko_Diktyo", "OID_Odikou_Diktyou");
sql2008Layer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.SecondaryRoad2;
sql2008Layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Map1.StaticOverlay.Layers.Add("Sql2008Layer", sql2008Layer);
finally
{
// sqlConnection.Close();
}
}
I have changed the .aspx file and turned the visible="false" attribute off
Any help would be a appreciated
dimitris