1

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);
  • Did you verify that the feature class is registered as versioned in the SDE geodatabase? Can you manually edit the feature class using ArcMap? – Tim Sexton Feb 5 '15 at 18:27
  • Yes, I've versioned the feature class. I can also edit it in ArcMap. – user1251774 Feb 6 '15 at 2:46
  • Check the IEngineEditor.EditSessionMode Property and verify that it's set to "esriEngineEditSessionModeVersioned". This property only applies when editing an SDE Workspace. – Tim Sexton Feb 6 '15 at 12:51
  • I have tried but still same error. I've also try IWorkspaceEdit, there's no problem. I can edit the sde feature class, but base on ESRI Resources this is not an appropriate approach and should be use when perform edit programmatically. – user1251774 Feb 9 '15 at 6:59
1

I don't have a "50 reputation" to comment yet so I have to comment like this:

What is the licensed product of ArcGIS that you are running? ArcGIS Basic (formerly ArcView) cannot edit an SDE workspace so if that is what you are using that could be your problem. If you are using ArcEngine, verify the licensed product that you are initializing your application with.

  • I'm init my application using ArcEngine Enterprise GeoDatabase and I've also had try to initialize my applicaton with ArcGIS Advance license but still get the same result. – user1251774 Feb 5 '15 at 2:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.