In the upcoming version we will release on May 1st, a GeoDbf class will be exposed with which you can directly operate a dbf file. But we still don’t have the method to insert/modify/delete a column. We used to have this function in Map Suite 2.0 but as dbf structure itself is not suitable for adding/removing columns, to implement that, internally we need to create a new dbf file, copy all the data there and replace the original file. This method is easily to be abused and it has a low performance. For example, if I want to add 2 new columns and call AddColumn() method twice, internally it will do the copies twice. That’s a reason we removed this method in 3.0 kind of reminding people DBF is not suitable to do this operation, if you implement it by yourself, you can have a better performance and have a good understand about the logic behind the scene.
Thanks for your reply, Ben does any temporarily .dll to release? because i’d like to use this method for modify dbf column. if you can, give me new .dll and a simple sample. Thanks a lot. :)
We are planning to add an API as following as soon as possible and it should be available in next public release around May 1st. public void UpdateColumnName(int columnNumber, string newColummName)
Yale, I try to use new API as follows: Could you help me to see what’s wrong? Road_AL.dbf has many records and 2 columns.
GeoDbf dbfRoad = new GeoDbf(@“D:\Road_AL.dbf”, DbfReadWriteMode.ReadWrite); int recordCount=dbfRoad.RecordCount; //the result of recordCount=0. dbfRoad.UpdateColumnName(2, “ID”); //error: Your input index is out of bound dbfRoad.DeleteRecord(1);