AnsweredAssumed Answered

locators not showing up in IWorkspace.get_Datasets

Question asked by tedrakel on May 22, 2013
Latest reply on May 23, 2013 by tedrakel
I have a locator in a sde versioned geodatabase.  When I call IWorkspace.get_Datasets(esriDatasetType.esriDTLocator), I don't get the locator.  Shouldn't locators show up using this interface?  I hope to be able to copy the locator from an sde geodatabase into a file geodatabase eventually.  If that's not possible, please let me know.

Here's my code in C# :

            // Get the SDE instance's default version.
            IVersionedWorkspace versionedWorkspace = (IVersionedWorkspace)sdeWorkspace;
            IVersion defaultVersion = null;
                defaultVersion = versionedWorkspace.DefaultVersion;
                IWorkspace defVersionWorkspace = (IWorkspace)defaultVersion;
                IEnumDataset eds = defVersionWorkspace.get_Datasets(esriDatasetType.esriDTLocator);
                IDataset ds = eds.Next();
                while (ds != null)
                    Console.WriteLine(ds.Name);  // this never gets executed because ds = null
                    ds = eds.Next();