Hello guys
I have a shapefile and I want to read the attribute value but row by row not filed by field !
Because I want to put each row value on the featureclass object (insertion) without using featurelayer object . You can see my code below I tried to use featurebuffer,featurecursor but I didn't make it successfully .Please anyone help me ,Thank you
- for(int i=0;i< distincfiles.length;i++)
- IWorkspaceFactory pwsf = new ShapefileWorkspaceFactory();
- IWorkspace pws = pwsf.OpenFromFile(distincfiles[i], 0);
- IEnumDataset pEnumDs = pws.Datasets[esriDatasetType.esriDTAny];
- IDataset pds = pEnumDs.Next();
-
- while (pds != null)
- {
- string name = pds.Name;
- string shapeGeomType = "Unknown";
- IFeatureClass pfc = (IFeatureClass)pds;
- IFields C = pfc.Fields;
- int s = pfc.Fields.FieldCount;
- esriGeometryType shp = pfc.ShapeType;
- if (shp == esriGeometryType.esriGeometryPolyline)
- {
- shapeGeomType = "Polyline";
- }
- if (shp == esriGeometryType.esriGeometryLine)
- {
- shapeGeomType = "Line";
- }
- if (shp == esriGeometryType.esriGeometryMultipoint || shp == esriGeometryType.esriGeometryPoint)
- {
- shapeGeomType = "Point";
- }
- if (shp == esriGeometryType.esriGeometryPolygon)
- {
- shapeGeomType = "Polygon";
- }
- int cntFeat = pfc.FeatureCount(null);
- dataGridView1.Rows.Add(name, CategoryName, cntFeat, missingfieldstatus.ToString());
- pds = pEnumDs.Next();
-
- }
- }
- }
- dataGridView1.Visible = true;
- }