arcengine9.2中如何读写shp.txt
来自「arcgisEngine对.shp文件的读写和修改」· 文本 代码 · 共 35 行
TXT
35 行
请教一下,在AE中,如何读写*.shp对应的属性表里的数据。给个思路的方向就可以了,知道的告知一下,谢谢!
用IWorkspacefactory打开就可以读了撒
得把.shp数据导入到gdb数据库中,然后再操作。
已经解决,感谢楼上两位!
如下是读的代码
System.Data.OleDb.OleDbConnection shapeConn = new System.Data.OleDb.OleDbConnection();
String oledbConnectionString;
// Set the connection string.
oledbConnectionString = "Provider=ESRI.GeoDB.OleDB.1;Data Source=F:\\map;Extended Properties=workspacetype=esriDataSourcesFile.ShapefileWorkspaceFactory.1;Geometry=WKB";
shapeConn.ConnectionString = oledbConnectionString;
// Open the connection.
shapeConn.Open();
System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand(" select * from Area_region ", shapeConn);
System.Data.OleDb.OleDbDataReader reader = command.ExecuteReader();
====
Area_region 是shape文件名,F:\\map是存放.shp文件的路径
这样好像只能读,不能写入吧
这样能写,但是只能做到SQL能做的事,也就是在那句SQL里面做文章,更多的操作就不能做了
IWorkSpaceEdit接口去实现
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?