A full Esri shape file consists of a master file, an index file, and a dBASE table file. The main file is a direct access, variable record length file in which each record describes a shape consisting of its vertex list. In the index file, each record is the offset in the main file from the header of the main file in the corresponding record. dBASE records the attributes recorded in the corresponding master file, and each master file record corresponds to a property record in dBASE. The one by one correspondence between geometric objects and attributes is based on the record number. Attribute records in a dBASE file must remain in the same order as the records in the master file. If you only need to process dbase files, you can use the operation of the database processing, the first download vfpodbc driver, directly installed.
- To establish a connection string
1string filedir = System.Environment.CurrentDirectory; 2 string relativepath = @ "beijing\ways.dbf" 3 filePath = Path.Combine (Filedir, relativepath); 4 connstr = @ "driver={microsoft Visual FoxPro Driver}; SOURCETYPE=DBF; Sourcedb=5 "; Exclusive=no; Null=no; Collate=machine; Backgroundfetch=no;deleted=no
- query statement
1 Span style= "color: #0000ff;" >string selectsql = @ " select * from + FilePath; 2 DataSet DataSet = Odbchelper.executedatas ET (ConnStr, CommandType.Text, selectsql); 3 datatable datatable = Dataset.tables[0];
- UPDATE statement
1 " Span style= "color: #0000ff;" >string updatesql = update " + FilePath + " SET len= " + length + " where ID = " + " " " + ID + " " " ; 2 odbchelper.executenonquery (connstr, CommandType.Text, updatesql);
Finally, the ArcGIS software verifies that the property information that is being modified has been updated.
Resources:
http://blog.csdn.net/lee576/article/details/9959357
C # Read properties information for SHP