I have a feature class.

IFeatureClass AOIfc = AOIfws.OpenFeatureClass("BrigadeAOI");

I need to be able to put this feature class into a feature dataset that is newly created. The following line of code doesn't work for me.

IFeatureDataset AOIfd = AOIfc.FeatureDataset;

How do I accomplish this? Thanks!

  • Could you please tag this post with the appropriate software/languages? Thanks
    – Aaron
    May 29 '13 at 15:03

You might be able to do this using IDatasetContainer.AddDataset.

From the IDatasetContainer documentation:

The IDatasetContainer interface lets you move datasets between feature datasets and workspaces. Both objects implement the interface. It should only be used to move datasets between feature datasets and the workspace level within a single workspace, however; it cannot be used to transfer datasets from one workspace to another.

  • Thank you for your help. I ended up just doing this using ArcCatalog. I won't try to create this in the code. Jun 3 '13 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.