Hi,
My vb.net code for 10.0, which returns ITable, does not work in 10.1. I've read that 10.1 has a new method for opening text files, but I can't find any details. Anyone solve this problem? Thanks!
Dim pTable As ITable = Nothing
Dim pMxDoc As IMxDocument = My.ArcMap.Document
Dim pMap As IMap = pMxDoc.FocusMap
Dim factoryType As Type = Type.GetTypeFromProgID("esriDataSourcesOleDB.TextFileWorkspaceFactory")
'last line in 10.1, exits the function here.
Dim workspaceFactory As ESRI.ArcGIS.Geodatabase.IWorkspaceFactory2 = CType(Activator.CreateInstance(factoryType),IWorkspaceFactory2)
Dim workspace As IWorkspace = workspaceFactory.OpenFromFile(pReachPath, 0)
Dim featureWorkspace As IFeatureWorkspace = CType(workspace, IFeatureWorkspace)
Try
pTable = featureWorkspace.OpenTable(pTableName)
Catch ex As System.Exception
Return Nothing
End Try