Use Shapefile.Categories.Generate,unable to delete .dbf file

Dec 29, 2011 at 2:08 AM
Edited Dec 29, 2011 at 2:08 AM

hello,

I'm developing an application which shall display a map (shapefile) and recreate it;

when display a shapefile need fill shape color, I use 

 //load shapefile after ,

shapefile.Categories.Generate(0, tkClassificationType.ctUniqueValues, 0);

//foreach shapeCollection

shapefile.Categories.Item[shpindex].DrawingOptions.FillColor = fillcolor ;

//recreate shapefile before ,close all layer  and delete Directory

map.RemoveAllLayers();

System.IO.Directory.Delete(mapFilePath, true);

but  unable to  delete .dbf file,  .dbf is opening ,

 

Can anybody explain me why this happens???

Any help is appreciated,

zzhi Valadas

Dec 29, 2011 at 8:09 AM

MapWindow 4.8.6 Have the same problem

open MapWindow Gis 4.8.6 

1、 Add Layer :Just that file, such as test.shp

2、 Categories-> Add Categoriey generation

3、 remove all layer

And then to delete  the file test.dbf


Dec 29, 2011 at 8:09 AM
Edited Dec 29, 2011 at 8:12 AM

MapWindow 4.8.6 Have the same problem

open MapWindow Gis 4.8.6 

1、 Add Layer :Just that file, such as test.shp

2、 Categories-> Add Categoriey generation

3、 remove all layer

And then to delete  the file test.dbf

windows Prompted abnormal, MapWindow Opening the file 

Dec 30, 2011 at 1:20 AM
Edited Dec 30, 2011 at 1:49 AM

Temporary solution

use  manually generated Categories

    shapefile.Categories.Add("");

    shapefile.ShapeCategory[shapeId] =categoriesIndex;

 Replaced

    shapefile.Categories.Generate

then can delete  .dbf file

Coordinator
Oct 4, 2012 at 7:37 AM

Using v4.8.7.4 I cannot reproduce this issue.

Can you install this version (http://tinyurl.com/mwMonthly) and confirm this has been fixed?

Thanks,

Paul