I have successfully opened a DBF Table:
String dbfDirectoryPath = "Z:/ESRI/data/washingtonCountyDataFiles/tlg_roads";
IWorkspaceFactory workspaceFactory = new ShapefileWorkspaceFactory();
IWorkspace workspace = workspaceFactory.OpenFromFile(dbfDirectoryPath, 0);
IFeatureWorkspace featureWorkspace = workspace as IFeatureWorkspace;
String dbfTable = "tlg_roads_l.dbf";
ITable table = featureWorkspace.OpenTable(dbfTable);
Now I want to map it, which I think entails a call to mapControl.AddLayer(layer). So I need to convert this object from a featureWorkspace to a ILayer somehow.
It looks like I can just CreateFeatureClass and then cast to an ILayer, but there are 6 arguments for CreateFeatureClass including CLSID so I get the impression I am missing some conceptual points. Thanks for any advice : )
//IFeatureClass featureclass = tableWorkspace.CreateFeatureClass //req six args, incl. CLSID
ILayer layer = featureclass as ILayer;
mapControl.AddLayer(layer);