<?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: List GDB Feature Classes in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/list-gdb-feature-classes/m-p/333498#M8691</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Actually, that's not the code you found there at all.&amp;nbsp; The code at that link is this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Do While fc &amp;lt;&amp;gt; ""

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(fc)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc = fcs.Next()

&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You've modified that code to append the feature class name to the variable fc with each loop iteration.&amp;nbsp; This is why fc will never be an empty string and why you a running into an infinite loop.&amp;nbsp; The code at that link works because it assigns the feature class name to the variable fc instead of appending it.&amp;nbsp; When fcs.Next() returns an empty string, fc will be assigned an empty string and the loop will terminate.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 15:47:19 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2021-12-11T15:47:19Z</dc:date>
    <item>
      <title>List GDB Feature Classes</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/list-gdb-feature-classes/m-p/333495#M8688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using a VB.NET code found in the ESRI Resource Center to list the content of a GDB.&amp;nbsp; For some reasons, it's not working.&amp;nbsp; It hangs or I get an empty string value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Imports ESRI.ArcGIS.Geodatabase
Imports ESRI.ArcGIS.Carto
Imports ESRI.ArcGIS.esriSystem
Imports System.Windows.Forms
Imports ESRI.ArcGIS.Geoprocessing
Imports ESRI.ArcGIS.Geoprocessor&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

Public Sub test()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim gp As New ESRI.ArcGIS.Geoprocessor.Geoprocessor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.SetEnvironmentValue("workspace", "G:\Data\GDB\Production.gdb")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim fcs As ESRI.ArcGIS.Geoprocessing.IGpEnumList = gp.ListFeatureClasses("*", "", "")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim fc As String = fcs.Next()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do While fc &amp;lt;&amp;gt; ""
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc = fc + vbNewLine + fcs.Next()
&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; MsgBox(fc)

End Sub&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 18:01:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/list-gdb-feature-classes/m-p/333495#M8688</guid>
      <dc:creator>DaveCouture</dc:creator>
      <dc:date>2013-12-19T18:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: List GDB Feature Classes</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/list-gdb-feature-classes/m-p/333496#M8689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your loop condition is to loop while fc is not an empty string.&amp;nbsp; You're setting the value of fc inside the loop to an actual value, so it will never be an empty string.&amp;nbsp; This results in an infinite loop because your loop condition will always be true.&amp;nbsp; The only exception is when no feature class names are returned at all, in which case fc is an empty string to start with.&amp;nbsp; In this case, you get the empty string.&amp;nbsp; In the case of the infinite loop, you get the hang.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 18:19:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/list-gdb-feature-classes/m-p/333496#M8689</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-12-19T18:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: List GDB Feature Classes</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/list-gdb-feature-classes/m-p/333497#M8690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Makes sense.&amp;nbsp; But, this is the code I found here, in the ESRI Developer Network: &lt;/SPAN&gt;&lt;A href="http://edndoc.esri.com/arcobjects/9.2/NET/74749fb9-9724-465f-9e1c-32c6faec1d5e.htm"&gt;http://edndoc.esri.com/arcobjects/9.2/NET/74749fb9-9724-465f-9e1c-32c6faec1d5e.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 11:23:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/list-gdb-feature-classes/m-p/333497#M8690</guid>
      <dc:creator>DaveCouture</dc:creator>
      <dc:date>2013-12-20T11:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: List GDB Feature Classes</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/list-gdb-feature-classes/m-p/333498#M8691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Actually, that's not the code you found there at all.&amp;nbsp; The code at that link is this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Do While fc &amp;lt;&amp;gt; ""

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(fc)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc = fcs.Next()

&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You've modified that code to append the feature class name to the variable fc with each loop iteration.&amp;nbsp; This is why fc will never be an empty string and why you a running into an infinite loop.&amp;nbsp; The code at that link works because it assigns the feature class name to the variable fc instead of appending it.&amp;nbsp; When fcs.Next() returns an empty string, fc will be assigned an empty string and the loop will terminate.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:47:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/list-gdb-feature-classes/m-p/333498#M8691</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2021-12-11T15:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: List GDB Feature Classes</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/list-gdb-feature-classes/m-p/333499#M8692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, thanks!&amp;nbsp; I'll create another string to append all the names.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Dec 2013 13:35:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/list-gdb-feature-classes/m-p/333499#M8692</guid>
      <dc:creator>DaveCouture</dc:creator>
      <dc:date>2013-12-20T13:35:51Z</dc:date>
    </item>
  </channel>
</rss>

