<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Find if version has edits in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/find-if-version-has-edits/m-p/263883#M6770</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When looking through the documentation, this can be done with the &lt;A href="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#IVersionedTable_Differences.htm"&gt;IVersionedTable.Differences&lt;/A&gt; method. (&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#72dfe883-e4d7-4925-835c-02bc513f91aa.htm" title="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#72dfe883-e4d7-4925-835c-02bc513f91aa.htm"&gt;http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#72dfe883-e4d7-4925-835c-02bc513f91aa.htm&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically you iterate through each&amp;nbsp;version you want to check for edits and set up IVersion objects for the child and parent version... &amp;nbsp;for each versioned object in SDE (I only check tables and features in the example below), cast it to IVersionedTable and call Differences with the type of edits you are looking for. &amp;nbsp;I call it 6 times. &amp;nbsp;It will return a DifferenceCursor which you can use to iterate over to see the IRow objects with differences.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to verify you are working with a versioned dataset or you&amp;nbsp;will receive an error when calling the Differences method, or you could call &lt;A href="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#IVersionedObject_IsRegisteredAsVersioned.htm"&gt;IsRegisteredAsVersioned&lt;/A&gt; from the IVersionedObject but I had very poor performance from this call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Differences method has 6 options for the table returned. &amp;nbsp;See &lt;A href="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#esriDifferenceType.htm"&gt;esriDifferenceType&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been developing the code below but I'm only checking versions with Default as the parent, which works for our environment. &amp;nbsp;I also check to see if the version has any potential conflicts without reconciling (esriDifferenceType 3 through 5). &amp;nbsp;The results have been accurate so far but I put this together pretty quickly. &amp;nbsp;This is part of a larger addin so you'll have to modify for your needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck~&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Imports ESRI.ArcGIS.esriSystem&lt;BR /&gt;Imports ESRI.ArcGIS.Geodatabase&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Module FindVersionChanges&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Private Sub writeLogLine(ByVal logLine As String)&lt;BR /&gt; Dim logFile As String = "C:\temp\test.csv"&lt;/P&gt;&lt;P&gt;Dim file As System.IO.StreamWriter&lt;BR /&gt; file = My.Computer.FileSystem.OpenTextFileWriter(logFile, True)&lt;BR /&gt; file.WriteLine(logLine)&lt;BR /&gt; file.Close()&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Friend Sub listVersionEdits()&lt;/P&gt;&lt;P&gt;writeLogLine("VersionName, VersionedObject, Inserts, Deletes, Updates, Conflict_Update_Update, Conflict_Update_Delete, Conflict_Delete_Update")&lt;/P&gt;&lt;P&gt;Dim connProp As IPropertySet = New PropertySetClass&lt;BR /&gt; With connProp&lt;BR /&gt; .SetProperty("DBCLIENT", "SQL")&lt;BR /&gt; .SetProperty("SERVER", String.Format("{0}\{1}", "&amp;lt;your&amp;nbsp;sql server&amp;gt;", "&amp;lt;sql instance&amp;gt;"))&lt;BR /&gt; .SetProperty("INSTANCE", String.Format("sde:sqlserver:{0}", .GetProperty("SERVER")))&lt;BR /&gt; .SetProperty("DATABASE", "PODS")&lt;BR /&gt; .SetProperty("AUTHENTICATION_MODE", "OSA")&amp;nbsp;&lt;BR /&gt; .SetProperty("VERSION", "sde.DEFAULT")&lt;BR /&gt; End With&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim sdeFactoryWkspType As Type = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory")&lt;BR /&gt; Dim sdeFactoryWksp As IWorkspaceFactory = CType(Activator.CreateInstance(sdeFactoryWkspType), IWorkspaceFactory)&lt;BR /&gt; Dim sdeWksp As IWorkspace = sdeFactoryWksp.Open(connProp, 0)&lt;BR /&gt; Dim clVersionWksp As IVersionedWorkspace4 = CType(sdeWksp, IVersionedWorkspace4)&lt;/P&gt;&lt;P&gt;Dim defaultVersion As IVersion = clVersionWksp.FindVersion("sde.DEFAULT")&lt;BR /&gt; Dim versionedDatasets As New List(Of String)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; ''get list of versioned data&lt;BR /&gt; Dim enumDatasets As IEnumDataset = sdeWksp.Datasets(esriDatasetType.esriDTAny)&lt;BR /&gt; Dim curDataset As IDataset = enumDatasets.Next()&lt;BR /&gt; While curDataset IsNot Nothing&lt;/P&gt;&lt;P&gt;If curDataset.Type = esriDatasetType.esriDTFeatureClass Or curDataset.Type = esriDatasetType.esriDTTable Then&lt;BR /&gt; Try&lt;BR /&gt; Dim versionedObj As IVersionedObject3 = CType(curDataset, IVersionedObject3)&lt;BR /&gt; ''If versionedObj.IsRegisteredAsVersioned Then versionedDatasets.Add(curDataset.Name)&lt;BR /&gt; versionedDatasets.Add(curDataset.Name)&lt;BR /&gt; versionedObj = Nothing&lt;BR /&gt; Catch ex As Exception&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Try&lt;/P&gt;&lt;P&gt;ElseIf curDataset.Type = esriDatasetType.esriDTFeatureDataset Then&lt;BR /&gt; Dim enumFeatDataset As IEnumDataset = curDataset.Subsets()&lt;BR /&gt; Dim subDataset As IDataset = enumFeatDataset.Next()&lt;BR /&gt; While subDataset IsNot Nothing&lt;BR /&gt; Try&lt;BR /&gt; If subDataset.Type = esriDatasetType.esriDTFeatureClass Then&lt;BR /&gt; Dim versionedObj As IVersionedObject3 = CType(subDataset, IVersionedObject3)&lt;BR /&gt; ''If versionedObj.IsRegisteredAsVersioned Then versionedDatasets.Add(curDataset.Name)&lt;BR /&gt; versionedObj = Nothing&lt;BR /&gt; End If&lt;BR /&gt; Catch ex As Exception&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Try&lt;/P&gt;&lt;P&gt;subDataset = enumFeatDataset.Next()&lt;BR /&gt; End While&lt;BR /&gt; If subDataset IsNot Nothing Then System.Runtime.InteropServices.Marshal.ReleaseComObject(subDataset)&lt;BR /&gt; If enumFeatDataset IsNot Nothing Then System.Runtime.InteropServices.Marshal.ReleaseComObject(enumFeatDataset)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;curDataset = enumDatasets.Next()&lt;BR /&gt; End While&lt;/P&gt;&lt;P&gt;If curDataset IsNot Nothing Then System.Runtime.InteropServices.Marshal.ReleaseComObject(curDataset)&lt;BR /&gt; If enumDatasets IsNot Nothing Then System.Runtime.InteropServices.Marshal.ReleaseComObject(enumDatasets)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; 'sort versioned objects&lt;BR /&gt; versionedDatasets.Sort()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; Dim allVersions As IEnumVersionInfo = clVersionWksp.Versions&lt;BR /&gt; Dim curVersion As IVersionInfo = allVersions.Next()&lt;BR /&gt; While curVersion IsNot Nothing&lt;BR /&gt; If curVersion.Parent.VersionName = "sde.DEFAULT" Then&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim curVersionVersion As IVersion = clVersionWksp.FindVersion(curVersion.VersionName)&lt;/P&gt;&lt;P&gt;For Each vDataset As String In versionedDatasets&lt;/P&gt;&lt;P&gt;Dim defaultFWS As IFeatureWorkspace = CType(defaultVersion, IFeatureWorkspace)&lt;BR /&gt; Dim curVersionFWS As IFeatureWorkspace = CType(curVersionVersion, IFeatureWorkspace)&lt;/P&gt;&lt;P&gt;Dim defaultTable As ITable = defaultFWS.OpenTable(vDataset)&lt;BR /&gt; Dim curVerTable As ITable = curVersionFWS.OpenTable(vDataset)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; 'Create a difference cursor.&lt;BR /&gt; Dim versionedTable As IVersionedTable = CType(curVerTable, IVersionedTable)&lt;/P&gt;&lt;P&gt;Dim editCountInVersion As New Dictionary(Of String, Integer) From {{"INSERT", 0}, {"UPDATE", 0}, {"DELETE", 0}} ''update type : count&lt;BR /&gt; Dim conflictCount As New Dictionary(Of String, Integer) From {{"UPD_UPD", 0}, {"UPD_DEL", 0}, {"DEL_UPD", 0}} ''CurVersion_DefaultVersion&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; For x = 0 To 5&lt;/P&gt;&lt;P&gt;Try&lt;BR /&gt; Dim differenceCursor As IDifferenceCursor = versionedTable.Differences(defaultTable, x, Nothing)&lt;/P&gt;&lt;P&gt;Dim oid As Integer = -99&lt;BR /&gt; Dim differenceRow As IRow = Nothing&lt;BR /&gt; differenceCursor.Next(oid, differenceRow)&lt;BR /&gt; While oid &amp;lt;&amp;gt; -1&lt;BR /&gt; Select Case x&lt;BR /&gt; Case 0&lt;BR /&gt; editCountInVersion("INSERT") += 1&lt;BR /&gt; Case 1&lt;BR /&gt; editCountInVersion("DELETE") += 1&lt;BR /&gt; Case 2&lt;BR /&gt; editCountInVersion("UPDATE") += 1&lt;BR /&gt; Case 3&lt;BR /&gt; conflictCount("UPD_UPD") += 1&lt;BR /&gt; editCountInVersion("UPDATE") += 1&lt;BR /&gt; Case 4&lt;BR /&gt; conflictCount("UPD_DEL") += 1&lt;BR /&gt; editCountInVersion("UPDATE") += 1&lt;BR /&gt; Case 5&lt;BR /&gt; conflictCount("DEL_UPD") += 1&lt;BR /&gt; editCountInVersion("DELETE") += 1&lt;BR /&gt; End Select&lt;/P&gt;&lt;P&gt;differenceCursor.Next(oid, differenceRow)&lt;BR /&gt; End While&lt;/P&gt;&lt;P&gt;differenceRow = Nothing&lt;BR /&gt; differenceCursor = Nothing&lt;BR /&gt; Catch ex As Exception&lt;BR /&gt;'Debug.Print(String.Format("{0}, Error: {1}", vDataset, ex.Message))&lt;BR /&gt; End Try&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; Next&lt;/P&gt;&lt;P&gt;Dim logStr As String = String.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", curVersion.VersionName, vDataset,&lt;BR /&gt; editCountInVersion("INSERT"), editCountInVersion("DELETE"), editCountInVersion("UPDATE"),&lt;BR /&gt; conflictCount("UPD_UPD"), conflictCount("UPD_DEL"), conflictCount("DEL_UPD"))&lt;/P&gt;&lt;P&gt;Debug.Print(logStr)&lt;BR /&gt; writeLogLine(logStr)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;versionedTable = Nothing&lt;BR /&gt; curVerTable = Nothing&lt;BR /&gt; defaultTable = Nothing&lt;BR /&gt; curVersionFWS = Nothing&lt;BR /&gt; defaultFWS = Nothing&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;curVersionVersion = Nothing&lt;/P&gt;&lt;P&gt;Else&lt;BR /&gt; Debug.Print(String.Format("{0}, Version not child of Default... skipping", curVersion.VersionName))&lt;BR /&gt; End If&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; curVersion = allVersions.Next()&lt;BR /&gt; End While&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;End Module&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Mar 2017 19:26:42 GMT</pubDate>
    <dc:creator>TravisStanley1</dc:creator>
    <dc:date>2017-03-08T19:26:42Z</dc:date>
    <item>
      <title>Find if version has edits</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/find-if-version-has-edits/m-p/263881#M6768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently trying to find out how I could get the information, if a specific version of my versioned workspace has changes or not. The purpose is to provide the information to a user over all versions avaliable. Therefor, i cannot use IVersionEdit.ModifiedClasses, as If I understand, this will only return something after reconcile.&lt;/P&gt;&lt;P&gt;Is there a way to find out, if a version has local changes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lionel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2016 13:48:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/find-if-version-has-edits/m-p/263881#M6768</guid>
      <dc:creator>LionelMartz</dc:creator>
      <dc:date>2016-12-16T13:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Find if version has edits</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/find-if-version-has-edits/m-p/263882#M6769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know &lt;EM&gt;ArcObjects&lt;/EM&gt;, but can throw out some ideas from the user side of versioned editing to see if that rings a bell and correlates with an ArcObject process/method.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In SDE, there is a &lt;EM&gt;Version Changes&lt;/EM&gt; command and tool.&amp;nbsp; Maybe the ArcObjects part of this is exposed so it can be implemented?&amp;nbsp; &lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/geodatabases/the-version-changes-command.htm" title="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/geodatabases/the-version-changes-command.htm"&gt;Using the Version Changes command—ArcGIS Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Edits to Versioned data is tracked by &lt;EM&gt;Delta tables&lt;/EM&gt;.&amp;nbsp; If you can access the &lt;EM&gt;Add&lt;/EM&gt; and &lt;EM&gt;Delete&lt;/EM&gt; tables and they have records, then the version was edited.&amp;nbsp; Maybe there is an ArcObjects way to query them?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris Donohue, GISP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2016 17:58:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/find-if-version-has-edits/m-p/263882#M6769</guid>
      <dc:creator>ChrisDonohue__GISP</dc:creator>
      <dc:date>2016-12-16T17:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Find if version has edits</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/find-if-version-has-edits/m-p/263883#M6770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When looking through the documentation, this can be done with the &lt;A href="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#IVersionedTable_Differences.htm"&gt;IVersionedTable.Differences&lt;/A&gt; method. (&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#72dfe883-e4d7-4925-835c-02bc513f91aa.htm" title="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#72dfe883-e4d7-4925-835c-02bc513f91aa.htm"&gt;http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#72dfe883-e4d7-4925-835c-02bc513f91aa.htm&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically you iterate through each&amp;nbsp;version you want to check for edits and set up IVersion objects for the child and parent version... &amp;nbsp;for each versioned object in SDE (I only check tables and features in the example below), cast it to IVersionedTable and call Differences with the type of edits you are looking for. &amp;nbsp;I call it 6 times. &amp;nbsp;It will return a DifferenceCursor which you can use to iterate over to see the IRow objects with differences.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to verify you are working with a versioned dataset or you&amp;nbsp;will receive an error when calling the Differences method, or you could call &lt;A href="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#IVersionedObject_IsRegisteredAsVersioned.htm"&gt;IsRegisteredAsVersioned&lt;/A&gt; from the IVersionedObject but I had very poor performance from this call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Differences method has 6 options for the table returned. &amp;nbsp;See &lt;A href="http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#esriDifferenceType.htm"&gt;esriDifferenceType&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been developing the code below but I'm only checking versions with Default as the parent, which works for our environment. &amp;nbsp;I also check to see if the version has any potential conflicts without reconciling (esriDifferenceType 3 through 5). &amp;nbsp;The results have been accurate so far but I put this together pretty quickly. &amp;nbsp;This is part of a larger addin so you'll have to modify for your needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck~&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Imports ESRI.ArcGIS.esriSystem&lt;BR /&gt;Imports ESRI.ArcGIS.Geodatabase&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Module FindVersionChanges&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Private Sub writeLogLine(ByVal logLine As String)&lt;BR /&gt; Dim logFile As String = "C:\temp\test.csv"&lt;/P&gt;&lt;P&gt;Dim file As System.IO.StreamWriter&lt;BR /&gt; file = My.Computer.FileSystem.OpenTextFileWriter(logFile, True)&lt;BR /&gt; file.WriteLine(logLine)&lt;BR /&gt; file.Close()&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Friend Sub listVersionEdits()&lt;/P&gt;&lt;P&gt;writeLogLine("VersionName, VersionedObject, Inserts, Deletes, Updates, Conflict_Update_Update, Conflict_Update_Delete, Conflict_Delete_Update")&lt;/P&gt;&lt;P&gt;Dim connProp As IPropertySet = New PropertySetClass&lt;BR /&gt; With connProp&lt;BR /&gt; .SetProperty("DBCLIENT", "SQL")&lt;BR /&gt; .SetProperty("SERVER", String.Format("{0}\{1}", "&amp;lt;your&amp;nbsp;sql server&amp;gt;", "&amp;lt;sql instance&amp;gt;"))&lt;BR /&gt; .SetProperty("INSTANCE", String.Format("sde:sqlserver:{0}", .GetProperty("SERVER")))&lt;BR /&gt; .SetProperty("DATABASE", "PODS")&lt;BR /&gt; .SetProperty("AUTHENTICATION_MODE", "OSA")&amp;nbsp;&lt;BR /&gt; .SetProperty("VERSION", "sde.DEFAULT")&lt;BR /&gt; End With&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim sdeFactoryWkspType As Type = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory")&lt;BR /&gt; Dim sdeFactoryWksp As IWorkspaceFactory = CType(Activator.CreateInstance(sdeFactoryWkspType), IWorkspaceFactory)&lt;BR /&gt; Dim sdeWksp As IWorkspace = sdeFactoryWksp.Open(connProp, 0)&lt;BR /&gt; Dim clVersionWksp As IVersionedWorkspace4 = CType(sdeWksp, IVersionedWorkspace4)&lt;/P&gt;&lt;P&gt;Dim defaultVersion As IVersion = clVersionWksp.FindVersion("sde.DEFAULT")&lt;BR /&gt; Dim versionedDatasets As New List(Of String)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; ''get list of versioned data&lt;BR /&gt; Dim enumDatasets As IEnumDataset = sdeWksp.Datasets(esriDatasetType.esriDTAny)&lt;BR /&gt; Dim curDataset As IDataset = enumDatasets.Next()&lt;BR /&gt; While curDataset IsNot Nothing&lt;/P&gt;&lt;P&gt;If curDataset.Type = esriDatasetType.esriDTFeatureClass Or curDataset.Type = esriDatasetType.esriDTTable Then&lt;BR /&gt; Try&lt;BR /&gt; Dim versionedObj As IVersionedObject3 = CType(curDataset, IVersionedObject3)&lt;BR /&gt; ''If versionedObj.IsRegisteredAsVersioned Then versionedDatasets.Add(curDataset.Name)&lt;BR /&gt; versionedDatasets.Add(curDataset.Name)&lt;BR /&gt; versionedObj = Nothing&lt;BR /&gt; Catch ex As Exception&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Try&lt;/P&gt;&lt;P&gt;ElseIf curDataset.Type = esriDatasetType.esriDTFeatureDataset Then&lt;BR /&gt; Dim enumFeatDataset As IEnumDataset = curDataset.Subsets()&lt;BR /&gt; Dim subDataset As IDataset = enumFeatDataset.Next()&lt;BR /&gt; While subDataset IsNot Nothing&lt;BR /&gt; Try&lt;BR /&gt; If subDataset.Type = esriDatasetType.esriDTFeatureClass Then&lt;BR /&gt; Dim versionedObj As IVersionedObject3 = CType(subDataset, IVersionedObject3)&lt;BR /&gt; ''If versionedObj.IsRegisteredAsVersioned Then versionedDatasets.Add(curDataset.Name)&lt;BR /&gt; versionedObj = Nothing&lt;BR /&gt; End If&lt;BR /&gt; Catch ex As Exception&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Try&lt;/P&gt;&lt;P&gt;subDataset = enumFeatDataset.Next()&lt;BR /&gt; End While&lt;BR /&gt; If subDataset IsNot Nothing Then System.Runtime.InteropServices.Marshal.ReleaseComObject(subDataset)&lt;BR /&gt; If enumFeatDataset IsNot Nothing Then System.Runtime.InteropServices.Marshal.ReleaseComObject(enumFeatDataset)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;curDataset = enumDatasets.Next()&lt;BR /&gt; End While&lt;/P&gt;&lt;P&gt;If curDataset IsNot Nothing Then System.Runtime.InteropServices.Marshal.ReleaseComObject(curDataset)&lt;BR /&gt; If enumDatasets IsNot Nothing Then System.Runtime.InteropServices.Marshal.ReleaseComObject(enumDatasets)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; 'sort versioned objects&lt;BR /&gt; versionedDatasets.Sort()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; Dim allVersions As IEnumVersionInfo = clVersionWksp.Versions&lt;BR /&gt; Dim curVersion As IVersionInfo = allVersions.Next()&lt;BR /&gt; While curVersion IsNot Nothing&lt;BR /&gt; If curVersion.Parent.VersionName = "sde.DEFAULT" Then&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim curVersionVersion As IVersion = clVersionWksp.FindVersion(curVersion.VersionName)&lt;/P&gt;&lt;P&gt;For Each vDataset As String In versionedDatasets&lt;/P&gt;&lt;P&gt;Dim defaultFWS As IFeatureWorkspace = CType(defaultVersion, IFeatureWorkspace)&lt;BR /&gt; Dim curVersionFWS As IFeatureWorkspace = CType(curVersionVersion, IFeatureWorkspace)&lt;/P&gt;&lt;P&gt;Dim defaultTable As ITable = defaultFWS.OpenTable(vDataset)&lt;BR /&gt; Dim curVerTable As ITable = curVersionFWS.OpenTable(vDataset)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; 'Create a difference cursor.&lt;BR /&gt; Dim versionedTable As IVersionedTable = CType(curVerTable, IVersionedTable)&lt;/P&gt;&lt;P&gt;Dim editCountInVersion As New Dictionary(Of String, Integer) From {{"INSERT", 0}, {"UPDATE", 0}, {"DELETE", 0}} ''update type : count&lt;BR /&gt; Dim conflictCount As New Dictionary(Of String, Integer) From {{"UPD_UPD", 0}, {"UPD_DEL", 0}, {"DEL_UPD", 0}} ''CurVersion_DefaultVersion&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; For x = 0 To 5&lt;/P&gt;&lt;P&gt;Try&lt;BR /&gt; Dim differenceCursor As IDifferenceCursor = versionedTable.Differences(defaultTable, x, Nothing)&lt;/P&gt;&lt;P&gt;Dim oid As Integer = -99&lt;BR /&gt; Dim differenceRow As IRow = Nothing&lt;BR /&gt; differenceCursor.Next(oid, differenceRow)&lt;BR /&gt; While oid &amp;lt;&amp;gt; -1&lt;BR /&gt; Select Case x&lt;BR /&gt; Case 0&lt;BR /&gt; editCountInVersion("INSERT") += 1&lt;BR /&gt; Case 1&lt;BR /&gt; editCountInVersion("DELETE") += 1&lt;BR /&gt; Case 2&lt;BR /&gt; editCountInVersion("UPDATE") += 1&lt;BR /&gt; Case 3&lt;BR /&gt; conflictCount("UPD_UPD") += 1&lt;BR /&gt; editCountInVersion("UPDATE") += 1&lt;BR /&gt; Case 4&lt;BR /&gt; conflictCount("UPD_DEL") += 1&lt;BR /&gt; editCountInVersion("UPDATE") += 1&lt;BR /&gt; Case 5&lt;BR /&gt; conflictCount("DEL_UPD") += 1&lt;BR /&gt; editCountInVersion("DELETE") += 1&lt;BR /&gt; End Select&lt;/P&gt;&lt;P&gt;differenceCursor.Next(oid, differenceRow)&lt;BR /&gt; End While&lt;/P&gt;&lt;P&gt;differenceRow = Nothing&lt;BR /&gt; differenceCursor = Nothing&lt;BR /&gt; Catch ex As Exception&lt;BR /&gt;'Debug.Print(String.Format("{0}, Error: {1}", vDataset, ex.Message))&lt;BR /&gt; End Try&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; Next&lt;/P&gt;&lt;P&gt;Dim logStr As String = String.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", curVersion.VersionName, vDataset,&lt;BR /&gt; editCountInVersion("INSERT"), editCountInVersion("DELETE"), editCountInVersion("UPDATE"),&lt;BR /&gt; conflictCount("UPD_UPD"), conflictCount("UPD_DEL"), conflictCount("DEL_UPD"))&lt;/P&gt;&lt;P&gt;Debug.Print(logStr)&lt;BR /&gt; writeLogLine(logStr)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;versionedTable = Nothing&lt;BR /&gt; curVerTable = Nothing&lt;BR /&gt; defaultTable = Nothing&lt;BR /&gt; curVersionFWS = Nothing&lt;BR /&gt; defaultFWS = Nothing&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;curVersionVersion = Nothing&lt;/P&gt;&lt;P&gt;Else&lt;BR /&gt; Debug.Print(String.Format("{0}, Version not child of Default... skipping", curVersion.VersionName))&lt;BR /&gt; End If&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; curVersion = allVersions.Next()&lt;BR /&gt; End While&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;End Module&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2017 19:26:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/find-if-version-has-edits/m-p/263883#M6770</guid>
      <dc:creator>TravisStanley1</dc:creator>
      <dc:date>2017-03-08T19:26:42Z</dc:date>
    </item>
  </channel>
</rss>

