You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - ArcObjects Visual Basic for Application (VBA) forum

Delete Feature Class from a Dataset   Luis Pedraz Mar 14, 2008
Re: Delete Feature Class from a Dataset   Neil Clemmons Mar 14, 2008
Re: Delete Feature Class from a Dataset   Luis Pedraz Mar 14, 2008
Re: Delete Feature Class from a Dataset   Neil Clemmons Mar 14, 2008
Re: Delete Feature Class from a Dataset   Luis Pedraz Mar 17, 2008
Re: Delete Feature Class from a Dataset   shanmuga sundaram Masanam Mar 17, 2008
Re: Delete Feature Class from a Dataset   Luis Pedraz Mar 17, 2008
Re: Delete Feature Class from a Dataset   shanmuga sundaram Masanam Mar 17, 2008
Re: Delete Feature Class from a Dataset   Jakub Sisak Apr 18, 2008
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Delete Feature Class from a Dataset 
Author Luis Pedraz 
Date Mar 14, 2008 
Message Hello,
I just want to delete through VBA an specific Feature Class that is inside a Dataset. Can someone help me?
Thanks in advance,
Luis 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Delete Feature Class from a Dataset 
Author Neil Clemmons 
Date Mar 14, 2008 
Message Use IDataset::Delete. 
  Neil Clemmons
Senior GIS Developer
Geographic Information Services, Inc.
Birmingham, AL
http://www.gis-services.com

Check out our blog:
http://blog.gis-services.com/ 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Delete Feature Class from a Dataset 
Author Luis Pedraz 
Date Mar 14, 2008 
Message But, I just want to delete one feature class in the Dataset, not all the Dataset.Is there any way to do that? 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Delete Feature Class from a Dataset 
Author Neil Clemmons 
Date Mar 14, 2008 
Message IDataset is implemented by many coclasses, including FeatureClass. QI from IFeatureClass to IDataset. 
  Neil Clemmons
Senior GIS Developer
Geographic Information Services, Inc.
Birmingham, AL
http://www.gis-services.com

Check out our blog:
http://blog.gis-services.com/ 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Delete Feature Class from a Dataset 
Author Luis Pedraz 
Date Mar 17, 2008 
Message Could you please show me a piece of code about that?
Thank you 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Delete Feature Class from a Dataset 
Author shanmuga sundaram Masanam 
Date Mar 17, 2008 
Message HI

here i attached the code for shape file as well as access workspace.
i hope it helps
cheers 
 
'FOR SHAPEWORKSPACE

ESRI.ArcGIS.Geodatabase.IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesFile.ShapefileWorkspaceFactoryClass();
//file path
ESRI.ArcGIS.Geodatabase.IWorkspace workspace = workspaceFactory.OpenFromFile("D:\\Data\\Esridata\\USA", 0);

//Cast to IFeatureWorkspace.
ESRI.ArcGIS.Geodatabase.IFeatureWorkspace featureWorkspace = (ESRI.ArcGIS.Geodatabase.IFeatureWorkspace)workspace;

//set featureclass name
ESRI.ArcGIS.Geodatabase.IFeatureClass featureClass = featureWorkspace.OpenFeatureClass("States");

ESRI.ArcGIS.Geodatabase.IDataset pdataset;

pdataset = (ESRI.ArcGIS.Geodatabase.IDataset)featureClass;
pdataset.Delete();


'FOR ACCESS WORKSPACE

Dim workspaceFactory As ESRI.ArcGIS.DataSourcesGDB.AccessWorkspaceFactory = New ESRI.ArcGIS.DataSourcesGDB.AccessWorkspaceFactory()
//file path
ESRI.ArcGIS.Geodatabase.IWorkspace workspace = workspaceFactory.OpenFromFile("D:\\Data\\Esridata\\USA", 0);

//Cast to IFeatureWorkspace.
ESRI.ArcGIS.Geodatabase.IFeatureWorkspace featureWorkspace = (ESRI.ArcGIS.Geodatabase.IFeatureWorkspace)workspace;

//set featureclass name
ESRI.ArcGIS.Geodatabase.IFeatureClass featureClass = featureWorkspace.OpenFeatureClass("States");

ESRI.ArcGIS.Geodatabase.IDataset pdataset;

pdataset = (ESRI.ArcGIS.Geodatabase.IDataset)featureClass;
pdataset.Delete();
 
  Shanmuga sundaram
India
sundar2k20@gmail.com 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Delete Feature Class from a Dataset 
Author Luis Pedraz 
Date Mar 17, 2008 
Message Thank you very much. It works ok. 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Delete Feature Class from a Dataset 
Author shanmuga sundaram Masanam 
Date Mar 17, 2008 
Message hi
happy to know. pls mark it this forum as answered 
  Shanmuga sundaram
India
sundar2k20@gmail.com 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Delete Feature Class from a Dataset 
Author Jakub Sisak 
Date Apr 18, 2008 
Message Just thought i would mention that Neil (above) actually answered your question.... Please marks posts as answered not on the last post but where someone has actually provided the correct answer.
 
  Jakub Sisak
jsisak@dstgroup.com
www.dstgroup.com