TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abdullah Quzmar
NA
6
1k
Getting the row value from shapefile to featureclass(Arcobj)
Jul 10 2019 11:32 PM
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();
// ShapeDetail shap = null;
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();
// MessageBox.Show(NumMissingField + " " + "count of missing fields");// put it on the log
}
}
}
dataGridView1.Visible =
true
;
}
Reply
Answers (
0
)
ThreadPool.QueueUserWorkItem is not working in C# Console
How to run two Active Forms that pass data back and forth.