AnsweredAssumed Answered

Why i can't edit my featureClass using (.geodatabase) file

Question asked by ManelKeddar on Jul 27, 2017

hello i've generated (.geodatabase) and i ried to edit my featureClass by adding a new feature (polygon) using the following code : 

 

private async void startLocalDB()
{


var gdb = await Esri.ArcGISRuntime.Data.Geodatabase.OpenAsync(@"C:\Users\mkeddar\Documents\ArcGIS\geodblocal\poly\data\pocdb.geodatabase");
var table = gdb.GeodatabaseFeatureTables.ElementAt(0);
await table.LoadAsync();
MapPoint locationPoint = new MapPoint(-2.708471, 56.096575, 5000, SpatialReferences.Wgs84);
var pointCollection = new Esri.ArcGISRuntime.Geometry.PointCollection(SpatialReferences.Wgs84);
pointCollection.Add(-109.048, 40.998);
pointCollection.Add(-102.047, 40.998);
pointCollection.Add(-102.037, 36.989);
pointCollection.Add(-109.048, 36.998);

var poly = new Esri.ArcGISRuntime.Geometry.Polygon(pointCollection);
var attributes = new Dictionary<string, object>();
attributes.Add("polygon", poly);
if (table.LoadStatus == Esri.ArcGISRuntime.LoadStatus.Loaded)
{
// var lyr = new FeatureLayer(table);
MyMapView.Map = new Map();
// MyMapView.Map.OperationalLayers.Add(lyr);
var template = table.FeatureTemplates.FirstOrDefault() ?? table.FeatureTypes.FirstOrDefault(t => t.Templates.Any())?.Templates?.FirstOrDefault();
var feature = table.CreateFeature(attributes,locationPoint);

//var feature = table.CreateFeature(template);
await table.AddFeatureAsync(feature);

}

 

 

}

i don't know why this doesn't work and i have an exception telling me that the table doesn't support Create option , although i have a standard licence ArcMap 10.4  that i used to generate the mobile geodatabase i have the same problem when i work with (.mpk) file is it the problem with ArcGis runtime or with my ArcMap configuration ? i shared my .geodatabse file .thanks to help

 

cheers

Attachments

Outcomes