I have a problem to start an edit session in a Engine standalone application. To make sure that the problem is not within my own code I created a new MapControlApplication with the VS2010 wizard and added the code to start an edit session.
private void StartEditing()
{
IMap map = axMapControl1.Map;
//If an edit session has already been started, exit.
if (m_engineEditor.EditState != esriEngineEditState.esriEngineStateNotEditing)
return;
//Start editing the workspace of the first feature layer found.
for (int layerCounter = 0; layerCounter <= map.LayerCount - 1; layerCounter++)
{
ILayer currentLayer = map.get_Layer(layerCounter);
if (currentLayer is IFeatureLayer)
{
IFeatureLayer featureLayer = currentLayer as IFeatureLayer;
IDataset dataset = featureLayer.FeatureClass as IDataset;
IWorkspace workspace = dataset.Workspace;
m_engineEditor.StartEditing(workspace, map);
((IEngineEditLayers)m_engineEditor).SetTargetLayer(featureLayer, 0);
break;
}
}
}
This code throws a COM exception HRESULT: 0x8004021F and the Error code is -2147220961. I found in the help that this means that the license is not sufficient to edit this type of data (FDO_E_NO_EDIT_LISENCE).
I have an EDN subscription and I have ArcEngine and ArcGIS for Desktop Standard installed on my computer. The GDB that the map uses is a file geodatabase and contains some featureclasses and other tables that are connected with relationship classes.
I tried all possible license settings in the LicenseControl but the error is always the same. I also copied the contents to a personal GDB - same error.
There is no problem when the map is opened in ArcMap.
What could be the problem?
regards,
Thomas Waenke