Uzochris

VB.Net - Add dataset name to combobox

Discussion created by Uzochris on Feb 8, 2011
I'm using the code below to iterate and add dataset names in SDE GDB to a combobox. It works as expected however, I want to modify it to instead add only those that I specify by name. Another option is add those whose name strings start with, for example, tmpDB.gisadmin.state_.

Any help will be appreciated.

..................................................
Dim pworkspacefact As IWorkspaceFactory
pworkspacefact = New SdeWorkspaceFactoryClass
Dim pworkspace As IWorkspace2
pworkspace = pworkspacefact.Open(pOutSDEPropset, 0)

Dim pDataset1 As IDataset
pDataset1 = pworkspace

Dim pEnumdataset As IEnumDataset
pEnumdataset = pDataset1.Subsets
pDataset = pEnumdataset.Next
If TypeOf pDataset Is IFeatureDataset Then
Do Until pDataset Is Nothing


cboDatasets.Items.Add(pDataset.Name)

pDataset = pEnumdataset.Next

Loop
End If

Outcomes