I am totally new to arcobjects. I want to get the feature class names withın a dataset and add them to a listbox. I was able to get the dataset names but i do not know how to iterate through the feature class names within these datasets.
Public Sub GetWorkspace()
Dim pEnumGxObj As ESRI.ArcGIS.Catalog.IEnumGxObject
Dim pFCFilter As New ESRI.ArcGIS.Catalog.GxFilterWorkspaces
Dim pGxDatabase As ESRI.ArcGIS.Catalog.IGxDatabase2
Dim pGxDialog As New ESRI.ArcGIS.CatalogUI.GxDialog
Dim pGxObject As ESRI.ArcGIS.Catalog.IGxObject
Dim pWorkspace As ESRI.ArcGIS.Geodatabase.IWorkspace
pGxDialog.ObjectFilter = pFCFilter
If Not pGxDialog.DoModalOpen(My.ArcMap.Application.hWnd, pEnumGxObj) Then Exit Sub
pGxObject = pEnumGxObj.Next
If pGxObject Is Nothing Then Exit Sub
Try
If TypeOf pGxObject Is ESRI.ArcGIS.Catalog.IGxDatabase2 Then
pGxDatabase = pGxObject
pWorkspace = pGxDatabase.Workspace
System.Windows.Forms.MessageBox.Show(pWorkspace.PathName)
Else
System.Windows.Forms.MessageBox.Show("This is likely a shapefile workspace")
End If
Dim pEnumDSName = pWorkspace.DatasetNames(esriDatasetType.esriDTAny)
Dim pSdeDSName = pEnumDSName.Next
While Not pSdeDSName Is Nothing
ListBox1.Items.Add(pSdeDSName.Name)
pSdeDSName = pEnumDSName.Next
End While
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.ToString, "GetWorkspace")
End Try
End Sub