I used to find some materials and wrote an article
C # (. NET) operations on DBF (ArcGIS SHP Attribute Table)
URL: http://www.cnblogs.com/xiexiaokui/archive/2007/11/12/956984.html
However, none of the above methods succeeded, and I didn't know where the problem was.
Therefore, the previous statistics were performed using feature in ArcGIS, but the statistics on attribute data were too wasteful.
So in the afternoon, I began to look for information on direct operations on the DBF DATABASE. After testing, none of the methods on the Internet were available.
There are three technical routes:
1. Install FoxPro, or DBF driver, and use special DBF interfaces.
2. Data Conversion DBF-> Excel (*. xls)-> access
For the first two types of data, it is of course the last resort. It would be better if ado.net directly operates DBF data.
So I thought of using the system to generate a database connection string. I didn't need to hand-write it and finally the test was successful.CodeAs follows?
Code
Odbcconnection OCN = New Odbcconnection ( " DSN = DBASE files " );
String Select = " Select * from " + Textbox1.text;
Odbcdataadapter ODA = New Odbcdataadapter (select, OCN );
Datatable ODS = New Datatable ();
ODA. Fill (ODS );
Datagridview1.datasource = ODS;
Textbox1.text is a full path with a path and extension.