Uzochris

Enhance add datasets to combox code

Discussion created by Uzochris on Feb 14, 2011
Latest reply on Feb 15, 2011 by Uzochris
This code (below) adds datasets in a database  to a combobox. But the process is very slow because it goes through each of the over 100 datasets in the database even when I modify it to add only that I specify by name.

Just wondering if it is possible to make it run faster through any kind of enhance? Any thoughts 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