<?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: Getting Access to Feature Classes in File GDB without a Dataset? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-access-to-feature-classes-in-file-gdb/m-p/188080#M4895</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;For the stand-alone feature classes, pass in esriDTFeatureClass.&amp;nbsp; This will return an enumeration of feature class objects that you will need to loop through.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Neil.&amp;nbsp; I had tried that before, but when it threw the initial exception I didn't dig into it at all, thinking the avenue was a bust.&amp;nbsp; Since you said it was the way to go, I dug into it and using the esriDTFeatureClass works.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 May 2013 13:05:50 GMT</pubDate>
    <dc:creator>JohnStephens</dc:creator>
    <dc:date>2013-05-07T13:05:50Z</dc:date>
    <item>
      <title>Getting Access to Feature Classes in File GDB without a Dataset?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-access-to-feature-classes-in-file-gdb/m-p/188076#M4891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've got a script that works with many different forms of File GDBs.&amp;nbsp; Sometimes they have datasets and sometimes they dont.&amp;nbsp; For the ones that have datasets, I have the working code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;C# IWorkspaceFactory wsFact = new FileGDBWorkspaceFactoryClass(); IWorkspace ws = wsFact.OpenFromFile(database, 0); IEnumDataset enumDS = ws.get_Datasets(esriDatasetType.esriDTFeatureDataset); IFeatureDataset ds = (IFeatureDataset)enumDS.Next(); IEnumDataset enumFC = ds.Subsets; IDataset currFC = enumFC.Next(); FeatureClass fc = (FeatureClass)currFC;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, when the database doesn't have a dataset and it hits the 5th line it throws an error since enumDS.Next() is null.&amp;nbsp; I've tried to chance the esriDatasetType to esriDTFeatureClass, but that doesn't work.&amp;nbsp; I've also tried using the GeoProcessor (which I would prefer not to), but the ListFeatureClasses returns a blank string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm sure this has a simple solution, but I just cannot find it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 12:04:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/getting-access-to-feature-classes-in-file-gdb/m-p/188076#M4891</guid>
      <dc:creator>JohnStephens</dc:creator>
      <dc:date>2013-05-07T12:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Access to Feature Classes in File GDB without a Dataset?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-access-to-feature-classes-in-file-gdb/m-p/188077#M4892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you're trying to open a specific feature class then call the IFeatureWorkspace.OpenFeatureClass method.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 12:17:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/getting-access-to-feature-classes-in-file-gdb/m-p/188077#M4892</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-05-07T12:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Access to Feature Classes in File GDB without a Dataset?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-access-to-feature-classes-in-file-gdb/m-p/188078#M4893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If you're trying to open a specific feature class then call the IFeatureWorkspace.OpenFeatureClass method.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey Neil,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm actually trying to get access to something like an enumeration of the Feature Classes, because I need data from all of them.&amp;nbsp; I'm not sure that's possible with IFeatureWorkspace.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 12:26:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/getting-access-to-feature-classes-in-file-gdb/m-p/188078#M4893</guid>
      <dc:creator>JohnStephens</dc:creator>
      <dc:date>2013-05-07T12:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Access to Feature Classes in File GDB without a Dataset?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-access-to-feature-classes-in-file-gdb/m-p/188079#M4894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There are two types of feature classes in a geodatabase - stand-alone and those that belong to feature datasets.&amp;nbsp; To access them, use the IWorkspace.Datasets method.&amp;nbsp; You'll have to call it twice - once for datasets and once for stand-alone feature classes.&amp;nbsp; For the datasets, pass in esriDTFeatureDataset.&amp;nbsp; It will return an enumeration of the feature datasets that you will need to loop through.&amp;nbsp; For each dataset, use the Subsets method to return an enumeration of the feature classes it contains.&amp;nbsp; You'll need to loop through this enumeration to access each feature class.&amp;nbsp; For the stand-alone feature classes, pass in esriDTFeatureClass.&amp;nbsp; This will return an enumeration of feature class objects that you will need to loop through.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 12:31:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/getting-access-to-feature-classes-in-file-gdb/m-p/188079#M4894</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-05-07T12:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Access to Feature Classes in File GDB without a Dataset?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/getting-access-to-feature-classes-in-file-gdb/m-p/188080#M4895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;For the stand-alone feature classes, pass in esriDTFeatureClass.&amp;nbsp; This will return an enumeration of feature class objects that you will need to loop through.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Neil.&amp;nbsp; I had tried that before, but when it threw the initial exception I didn't dig into it at all, thinking the avenue was a bust.&amp;nbsp; Since you said it was the way to go, I dug into it and using the esriDTFeatureClass works.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 13:05:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/getting-access-to-feature-classes-in-file-gdb/m-p/188080#M4895</guid>
      <dc:creator>JohnStephens</dc:creator>
      <dc:date>2013-05-07T13:05:50Z</dc:date>
    </item>
  </channel>
</rss>

