Editing Version Issue

300
0
06-27-2017 06:52 AM
ShaningYu
Frequent Contributor

Below is the piece of code (an Add-In tool) I used for updating a feature layer loaded in a .mxd

        void Update_Layer(IFeatureLayer sourceLayer, IFeatureLayer targetLayer)  {
            IWorkspace ws = ((IDataset)targetLayer).Workspace;
            IPropertySet propSet = ws.ConnectionProperties;
            IVersion version = ((IVersionedWorkspace)ws).FindVersion(propSet.GetProperty("Version").ToString());

                  // version - myTestversion
            m_workspaceEdit = (IWorkspaceEdit)version;

            ....

         }

The targetLayer loaded in .mxd is myTestVersion.  In this updating, the results show that the featureClass in both myTestVersion and SDE.Default got updated.  I only want to update myTestVersion.  I don't know why it happens.  Thanks if you can help.

Tags (2)
0 Kudos
0 Replies