AnsweredAssumed Answered

Why does opening SDE Workspace Factory ask for credentials again?

Question asked by tayyabmir056 on Mar 10, 2019
Latest reply on Jun 29, 2019 by barmigen

I'm trying to open SDE Workspace Factory using IWorkspaceFactory.Open

I give the complete Property set in the code to open.

 

ESRI.ArcGIS.esriSystem.IPropertySet propertySet = new ESRI.ArcGIS.esriSystem.PropertySetClass();
propertySet.SetProperty("SERVER", "myServer");
propertySet.SetProperty("INSTANCE", "myinstance");
propertySet.SetProperty("AUTHENTICATION_MODE", "DBMS");
propertySet.SetProperty("DATABASE", "myDatabase");
propertySet.SetProperty("USER", "sde");
propertySet.SetProperty("PASSWORD", "sdePassword");
propertySet.SetProperty("VERSION", "sde.DEFAUALT");


IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactory();
IWorkspace workspace = workspaceFactory.Open(propertySet,0);

But When the workspaceFactory.Open is called, a dialogue box is opened to ask for credentials again.

 

Why does this happen?

Also, Can someone tell me what does the second parameter of IWorkspaceFactory.Open "hWnd" represent? I couldnt find a proper explanation in the documentation.

Outcomes