Hi all,
it's been a while since I've tried to do this, and my program keeps giving me and error when I launch the form. I'm using a new computer so I'm not sure if it's me or lack of the right software or what.
I've installed the SDK .Net for ArcObjects to Visual Studio 2008.
I'm creating a form to gather data and populate a file Geodatabase that contains Points, Polygons and tables.
I am currently trying to connect to the database. here is my code:
Private Sub frm_general_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Dataset As IWorkspace
Dataset = FileGdb("file_path")
End Sub
Public Shared Function FileGdb(ByVal Path As String) As IWorkspace
Dim factoryType As Type = Type.GetTypeFromProgID("esriDataSourcesGDB.FileGDBWorkspaceFactory")
Dim workspaceFactory As IWorkspaceFactory = CType(Activator.CreateInstance(factoryType), IWorkspaceFactory)
Return workspaceFactory.OpenFromFile(Path, 0)
End Function