I have created .geodatbase using the ArcGIS Runtime content ( Ver 10.2.1) but when I am trying to add this for offline method this is giving me "Geometry type does not match the geometry field." error.
var gdb3 = await Esri.ArcGISRuntime.Data.Geodatabase.OpenAsync(@".geodatabase");
foreach (var table in gdb3.FeatureTables.ToList())
{
// create a new feature layer to display each table
var lyr = new FeatureLayer
{
ID = table.Name + "Offline3",
DisplayName = table.Name,
FeatureTable = table
};
// add each layer to the map
MyMapView.Map.Layers.Add(lyr);
}
Hi, did you miss any code when pasting it here? Seems like the lyr object is still a new feature layer, and nothing has been assigned to it before added to the map.
Hi Yuan,
nothing is missing in code. This is giving error when open the geodatabase at very first line
"var gdb3 = await Esri.ArcGISRuntime.Data.Geodatabase.OpenAsync(@".geodatabase");"
and assigned the below properties when create the FeatureLayer.
var lyr = new FeatureLayer
{
ID = table.Name + "Offline3",
DisplayName = table.Name,
FeatureTable = table
};
Oops, my bad. I see it now