sylvesp

How to connect to an ArcSDE server (sde.default vs. dbo.default)

Discussion created by sylvesp on Aug 24, 2010
Hi there,

Could somebody please tell me how could I find out the name of the default version for an SDE database I am trying to connect to?

When opening an SDE connection you have to pass in the VERSION you want to connect to.
My problem is that I don't know in advance if that is named SDE.DEFAULT or DBO.DEFAULT.

Is there a way to find that out programatically - using the ArcObjects API?

---
e.g:
IPropertySet oProperSet = new PropertySetClass();

  oProperSet.SetProperty("Server", SDE_SERVER);
  oProperSet.SetProperty("Instance", SDE_INSTANCE);//default port:5151
  oProperSet.SetProperty("Database", DB_NAME);
  oProperSet.SetProperty("User",DB_USER_NAME);
  oProperSet.SetProperty("Password", DB_PASSWORD);
  oProperSet.SetProperty("Version", "SDE.DEFAULT"); //???????? How to find this if I don't know it in advance?

IWorkspaceFactory pSdeFact = new SdeWorkspaceFactoryClass();
IWorkspace oWorkspace = pSdeFact.Open(oProperSet, 0);

Thanks for your time.
Peter

Outcomes