cannot update a FeatureLayer which is not editable(esri web)

question:

Hi,
I am trying to sketch a polygon on the local mapCache by doing the code bellow:

FeatureLayer fl = mapCache1.CacheLayers[m_layer] as FeatureLayer;
FeatureLayerDataTable fldt = fl.GetDataTable();
DataRow dr;
Geometry g = sketchMapAction1.Geometry;
dr = fldt.NewRow();
dr[fldt.GeometryColumnIndex] = g;
fldt.Rows.Add(dr);
fldt.UpdateFeatureLayer(); // the error occur on this line and the application throws the following message:
"You cannot update a FeatureLayer which is not editable."

1) Do I have to add this layer to ArcSDE? How can I do this?

2) Why - if the anwser for the question above is yes - the layer must be added to ArcSDE(since is a local update)?

answer:

1. Yes you will need to put your feature layer inside a SDE database if you need to edit it in your mobile client app. You can use ArcCatalog to copy your feature class and paste it into a SDE database or put it under a feature dataset. As a last step you will need to change your arcmap document to make it reference to this new feature class, and re-publish it in ArcGIS Server as a mobile service.

2. The client map cache is created by retrieving the data from the server, and on the server side the feature class (if not in a SDE database) will be rendered as non-editable. This is by design because ArcGIS mobile client is supposed to synchronize with server at some point therefore the layer properties had to be be compliant with the server.

Hope this helps. 
  -Jay

你可能感兴趣的:(Web,cache,mobile)