Hi,I am also getting this error - but I DO have .net framework 4 installed. Any advice, please?
Imports ESRI.ArcGIS.esriSystem Imports ESRI.ArcGIS.esriSystem.esriExtensionState 'Open an ArcView License (To connect to the .GDB) Dim init As New AoInitialize() If Not init.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcView) = esriLicenseStatus.esriLicenseCheckedOut Then Return False End If 'Open a Connection to the .GDB Dim cn As OleDbConnection = FileGdbConnection(GDB_Path) cn.Open() 'Fill a DataTable will all the information from TABLE_NAME Dim cmd As New OleDbCommand("SELECT * FROM TABLE_NAME", cn) 'Dim cmd As New FileGDBCommand("SELECT * FROM TABLE_NAME", cn) Dim dt As New DataTable("TABLE_NAME") dt.Load(cmd.ExecuteReader()) 'Close Connections cn.Dispose() init.Shutdown()
Public Function FileGdbConnection(ByVal Path As String) As OleDbConnection ' Build the connection string. Dim fileGdbStringTemplate As String = "Provider=ESRI.GeoDB.OleDB.1;Data Source={0};" & "Extended Properties=workspacetype=esriDataSourcesGDB.FileGDBWorkspaceFactory.1;" Dim connectionString As String = String.Format(fileGdbStringTemplate, Path) ' Create the connection and return it. Dim fileGdbConn As OleDbConnection = New OleDbConnection() fileGdbConn.ConnectionString = connectionString Return fileGdbConn End Function
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.