AnsweredAssumed Answered

Issue while using "FileGDBWorkspaceFactory"

Question asked by SravaniTirumareddy on Dec 23, 2016
Latest reply on Dec 23, 2016 by bixb0012

IWorkspaceFactory factory= new FileGDBWorkspaceFactory();
IWorkspace workspace= factory.OpenFromFile(path, 0);


The above code causes throws the below error. "Error HRESULT E_FAIL has been returned from a call to a COM component."


Tried the below too. But it didn't work.

Type factoryType=Type.GetTypeFromProgID(         "esriDataSourcesGDB.FileGDBWorkspaceFactory");     IWorkspaceFactory workspaceFactory=(IWorkspaceFactory)Activator.CreateInstance         (factoryType);
IWorkspace workspace=workspaceFactory.OpenFromFile(path, 0);

I have following software installed, 

ArcGis 10.2.1

C# (.Net 4.5)


Please suggest the fix.