How to check fields exist in shp file

9/9/2017 3:21:27 PM
Total Posts 11

How to check fields exist in shp file

How to check fields exist in shp files?

regards

Bahar

9/11/2017 10:05:54 AM
MVP
Total Posts 323

Re: How to check fields exist in shp file

Use the Fields.GetFieldIndex method.

rs = layer.Recordset;

if (rs.Fields.GetFieldIndex("NAME") >= 0)

{

  // the NAME field exists

}