Unable to open IWorkspace using IWorkspaceFactory

المشرف العام

Administrator
طاقم الإدارة
I'm trying to open a workspace from the IWorkspaceFactory interface. Here's what I'm trying at the moment:

ESRI.ArcGIS.Carto.IFeatureLayer featureLayer = (ESRI.ArcGIS.Carto.IFeatureLayer)pLayer;ESRI.ArcGIS.Geodatabase.IFeatureClass oldFeatureClass = featureLayer.FeatureClass;IPropertySet propertySet = new PropertySetClass();propertySet.SetProperty("INSTANCE", newData.instance); //sde:sqlserver:(servername)propertySet.SetProperty("DATABASE", newData.database); //(databasename)propertySet.SetProperty("AUTHENTICATION_MODE", newData.autMode); //OSApropertySet.SetProperty("VERSION", newData.version); //sde.DEFAULTType factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory");IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);IWorkspace workspace = workspaceFactory.Open(propertySet, 0);For my properties I have also tried the following:

propertySet.SetProperty("SERVER", serverName);propertySet.SetProperty("INSTANCE", "sde:sqlserver:(database)"); propertySet.SetProperty("DATABASE", "SDE");propertySet.SetProperty("AUTHENTICATION_MODE", newData.autMode); //OSApropertySet.SetProperty("VERSION", newData.version); //sde.DEFAULTI know that the property settings are the issue as when I try using

propertySet.SetProperty("SERVERINSTANCE", serverName);It shows the new connection dialog.

To give you an idea of my values, I consider Instance in this window to be the server name. I consider database to be the database name. This should give you an idea of what I'm setting my values as.

Is there a property value that I'm missing or a value that is incorrect?



أكثر...
 
أعلى