Not successful in updating myVersion

375
1
06-30-2017 10:13 AM
ShaningYu
Frequent Contributor

I created a SDE Version and executed edit through ArcObjects.  However, the results show that not only myVersion is updated, but also the SDE.Default version is also updated.  See the code below.  I DID check-up / verify the version.  What's wrong with my code?  Did I miss something?  Thanks.

void Update_FC(IFeatureClass fc_Source, IFeatureClass fc_Target) {

   // Before updating using the 4 lines of code below to check/verify the version
   IWorkspace ws = fc_Target.FeatureDataset.Workspace;
   IPropertySet propSet = ws.ConnectionProperties;
   IVersionedWorkspace verWorkspace = (IVersionedWorkspace)ws;  // m_userWorkspace;//wsStop;
   IVersion ver = (IVersion)verWorkspace.FindVersion(cboVersion.SelectedItem.ToString());

   // update fc_Target

   ...

   feat = fc_Target.CreateFeature();

   ......

   feat.Store();

}

Tags (1)
0 Kudos
1 Reply
ShaningYu
Frequent Contributor

It was found that this problem was due to the crashed SDE DB.  After re-building the DB and creation of the version, the problem was gone.  Thanks for your review.

0 Kudos