vendredi 23 janvier 2015

Start Editing Return Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))


I'm using IEngineEditor.StartEditing method to start an edit session on SDE Workspace. My workspace is having a right value because I have no problem to get a feature class using it. I'm not sure where I did wrong, or what causing this error. Please help.



IPropertySet propertySet = new PropertySetClass();
propertySet.SetProperty("SERVER", MyServer);
propertySet.SetProperty("INSTANCE", MyInstance);
propertySet.SetProperty("DATABASE", MyDatabase);
propertySet.SetProperty("USER", MyUsername);
propertySet.SetProperty("PASSWORD", MyPassword);
propertySet.SetProperty("VERSION", MyVersion);

Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory");
IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);

IWorkspace workspace = workspaceFactory.Open(propertySet, 0);

IFeatureWorkspace pFeatureWorkspace = workSpace as IFeatureWorkspace;
IFeatureClass pFeatureClass = pFeatureWorkspace.OpenFeatureClass("MyFeatureClassName"); //I can get this feature class. This was for later use
IMap pMap = mapControl.Map;

engineEditor.StartEditing(workSpace, pMap);




Aucun commentaire:

Enregistrer un commentaire