Select to view content in your preferred language

unexpected behaviour of feature service

809
1
11-30-2011 12:10 PM
ForamParikh
Regular Contributor
Hello,

Everything was working fine but suddenly it has started unexpexted things.i want to add polygon feature from my feature service layer here is my code which is working fine,

                Graphic g = new Graphic();
                    GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
                     g.Geometry = graphicsLayer.Graphics[1].Geometry;
                  
                    g.SetZIndex(1);
                    g.Attributes.Add("LOCATION_ID", Int32.Parse(e.Result.ToString()));
                    g.Attributes.Add("FLAG", "Y");
                    FeatureLayer fpoly = MyMap.Layers["polygonlayer"] as FeatureLayer;
                    fpoly.Graphics.Add(g);
                    fpoly.SaveEdits();

now suddenly when i try to save the feature it fires FeatureLayer_SaveEditsFailed event but if i see in sql i can not see that record but in my feature layer i can see the record means if i fire the select * from polygonlayer it says 18 records means that new record is not added which is fine but if i see in url means http://mydomain/ArcGIS/rest/services and i open that layer and i fire query and i write 1=1 in where condition it says total :19 records and i can see that feature on my map which is not added in sql please help me..

Please advise,

this is very urgent because this will mess up my whole application because there are few tables are also connected with this feature.

Thanks
Foram
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
If FeatureLayer.SaveEditsFailed, you cannot expect the edits to push through the service. Kindly use Fiddler to monitor the web request/response, may be your geometry type or attribute value data type does not match what the service expects.

Have you tried using Editor.Add or TemplatePicker instead? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitEditorWidget.

It is possible to add graphics in code-behind but you may be missing attributes that need to be set. This seems related: http://forums.arcgis.com/threads/44168-Adding-a-point-to-a-featurelayer-using-coordinates
0 Kudos