I've set up an Oracle user Schema geodatabase and loaded some data into it. I now want to connect to it programmatically using ArcObjects, the problem is I don't see how. Where can I set the newly created schema name in my connection property set, or how do I change the schema value after I have connected? In ArcCatalog it is done in the Geodatabase connection properties window :
The code below works fine connecting to the default SDE schema. What do I have to change to connect to a user geodatabase? I have tried examining IDatabaseConnectionInfo2
and IWorkspaceProperties
but I don't see where I can set or change the schema that is connected to.
public static IWorkspace ConnectToTransactionalVersion(String dbclient, String dbConnProp, String user, String password, String database, String version, String authentication)
{
IPropertySet propertySet = new PropertySet();
propertySet.SetProperty("DBCLIENT", dbclient);
propertySet.SetProperty("DB_CONNECTION_PROPERTIES", dbConnProp);
propertySet.SetProperty("DATABASE", database);
propertySet.SetProperty("USER", user);
propertySet.SetProperty("PASSWORD", password);
propertySet.SetProperty("VERSION", version);
propertySet.SetProperty("AUTHENTICATION_MODE", authentication);
Type factoryType = Type.GetTypeFromProgID(
"esriDataSourcesGDB.SdeWorkspaceFactory");
IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance
(factoryType);
return workspaceFactory.Open(propertySet, 0);
}
I tried adding "SCHEMA" as a property in propertySet and it gets ignored, I also tried setting the version property to the new user schema default version but it errors with "version not found"
No comments:
Post a Comment