Using this sample code :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;
namespace Arc_1
{
public partial class Form1 : Form
{
private string path = @D:\ArcObjects\myfGDB.gdb;
public Form1()
{
InitializeComponent();
}
public static IWorkspace FileGdbWorkspaceFromPath(String path)
{
Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.FileGDBWorkspaceFactory");
IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);
return workspaceFactory.OpenFromFile(path, 0);
}
private void button1_Click(object sender, EventArgs e)
{
FileGdbWorkspaceFromPath(path);
MessageBox.Show("You are connected now");
}
}
}
But I am encountering with this errorRetrieving the COM class factory for component with CLSID {71FE75F0-EA0C-4406-873E-B7D53748AE7E} failed due to the following error: 80040111.I changed the project .Net framework from 4 to 3.5 client but smae thing still happening! Can you please let me know why this is happening?Thanks