<?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 duplicates values in feature class in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564055#M15196</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;I want to check if a specified field has duplicate records. is there to achieve this? I am using VB.NET.&lt;BR /&gt;Please any help will be helpful.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Summary Statistics and then look for values with a count of 2 or higher.&amp;nbsp; Relate or join to get the selection on the original features.&amp;nbsp; Then do whatever you need to do to deal with them.&amp;nbsp; This method is so fast and easy, I have not found a reason to program an alternative.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Jun 2013 21:11:25 GMT</pubDate>
    <dc:creator>RichardFairhurst</dc:creator>
    <dc:date>2013-06-30T21:11:25Z</dc:date>
    <item>
      <title>find duplicates values in feature class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564054#M15195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to check if a specified field has duplicate records. is there to achieve this? I am using VB.NET.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please any help will be helpful.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Jun 2013 17:44:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564054#M15195</guid>
      <dc:creator>RichardMoussopo</dc:creator>
      <dc:date>2013-06-30T17:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: find duplicates values in feature class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564055#M15196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;I want to check if a specified field has duplicate records. is there to achieve this? I am using VB.NET.&lt;BR /&gt;Please any help will be helpful.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Summary Statistics and then look for values with a count of 2 or higher.&amp;nbsp; Relate or join to get the selection on the original features.&amp;nbsp; Then do whatever you need to do to deal with them.&amp;nbsp; This method is so fast and easy, I have not found a reason to program an alternative.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Jun 2013 21:11:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564055#M15196</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2013-06-30T21:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: find duplicates values in feature class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564056#M15197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Another alternative that should work too is performing a dissolve on your featureClass. This process aggregates features based on a given field and adds a field to the output-fc which holds the number of aggregated features...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 11:57:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564056#M15197</guid>
      <dc:creator>CarstenSchumann</dc:creator>
      <dc:date>2013-07-02T11:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: find duplicates values in feature class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564057#M15198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Summary Statistics and then look for values with a count of 2 or higher.&amp;nbsp; Relate or join to get the selection on the original features.&amp;nbsp; Then do whatever you need to do to deal with them.&amp;nbsp; This method is so fast and easy, I have not found a reason to program an alternative.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your reply. But how do you achieve that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;here is my code for it but unfortunately, it counting the total features in the field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Try
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Defining the Layer selected by the end user
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim layer As String = ComboBoxLayerName.SelectedItem
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Converting the layer into a feature class
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim fclass As IFeatureClass = flayer(layer).FeatureClass
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'defining the field to be checked

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim fieldToCheck As IField = Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim fields As IFields = fclass.Fields
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim t As Integer = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do While (t &amp;lt; fields.FieldCount)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If fields.Field(t).Name = ComboBoxFieldName.SelectedItem Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldToCheck = fields.Field(t)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Do
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t = t + 1

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'define the cursor to store data
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pCursor As ICursor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'define datastat to query unique values
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pDataStats As New ESRI.ArcGIS.Geodatabase.DataStatistics
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'define data collection
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pEnum As System.Collections.IEnumerator
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim duplicateNumber As Integer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim duplicateValue As Integer = pDataStats.UniqueValueCount&amp;nbsp; '(DuplicateValue here returns the total records in the field)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ListViewResults.Items.Clear()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pCursor = fclass.Search(Nothing, False)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pDataStats.Field = fieldToCheck.Name
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pDataStats.Cursor = pCursor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnum = pDataStats.UniqueValues&amp;nbsp;&amp;nbsp; '(pEnum get Unique Values in the field)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnum.Reset()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pListItem As New ListViewItem
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do While pEnum.MoveNext
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; duplicateNumber = pDataStats.UniqueValueCount
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ListViewResults.Items.Add(pEnum.Current)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ListViewResults.Items(0).SubItems.Add(pDataStats.UniqueValueCount.ToString) '(return the total records number but not the number for each repeated records)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show(ex.Message)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:18:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564057#M15198</guid>
      <dc:creator>RichardMoussopo</dc:creator>
      <dc:date>2021-12-12T00:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: find duplicates values in feature class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564058#M15199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Richard,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would consider abandoning your approach of using the IDataStatistics interface as ESRI introduced a bug with the 10.1 SP1 release that is some sort of memory leak and will cause your application to fail. It is discussed in this &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/70997-ICursor-issue-in-10.1-SP-1"&gt;thread&lt;/A&gt;&lt;SPAN&gt;.I had terrible problems with my application failing until I stopped using it. Hopefully they will fix it in 10.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Richards idea of calling the summary tool is probably the easiest way of doing things.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2013 08:05:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564058#M15199</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2013-07-09T08:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: find duplicates values in feature class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564059#M15200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Richard,&lt;BR /&gt;&lt;BR /&gt;I would consider abandoning your approach of using the IDataStatistics interface as ESRI introduced a bug with the 10.1 SP1 release that is some sort of memory leak and will cause your application to fail. It is discussed in this &lt;A href="http://forums.arcgis.com/threads/70997-ICursor-issue-in-10.1-SP-1"&gt;thread&lt;/A&gt;.I had terrible problems with my application failing until I stopped using it. Hopefully they will fix it in 10.2&lt;BR /&gt;&lt;BR /&gt;Richards idea of calling the summary tool is probably the easiest way of doing things.&lt;BR /&gt;&lt;BR /&gt;Duncan&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you Duncan, you are right about IDataStatistics, it keeps failing after several runs. I don't seem to find Summary Command to be able to call it. any code for it please?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2013 01:16:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564059#M15200</guid>
      <dc:creator>RichardMoussopo</dc:creator>
      <dc:date>2013-07-10T01:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: find duplicates values in feature class</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564060#M15201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Richard,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Richard was talking about calling the existing Summary statistics tool. You would call it using the IGeoProcessor interface. This &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#/d/000100000102000000.htm"&gt;page&lt;/A&gt;&lt;SPAN&gt; shows an example of the calculate geo-processing tool being called. You can even call entire models.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2013 08:46:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/find-duplicates-values-in-feature-class/m-p/564060#M15201</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2013-07-10T08:46:52Z</dc:date>
    </item>
  </channel>
</rss>

