Hello,
My application throws an error wnen searching through a shape file:
"The process cannot access the file '...\xxx.dbf' because it is being used by another process."
Here is my code:
ShapeFileFeatureLayer allProperties = new ShapeFileFeatureLayer(context.Server.MapPath("~/.../xxx.shp"));
allProperties.Open();
DataTable dt = allProperties.QueryTools.ExecuteQuery("SELECT PropertyNa, Longitude, Latitude, StatusID, DrillHole, Featured FROM All WHERE PropertyID IN (" + propertyIds + ") ");
allProperties.Close();
I guess, it happened because the search through a shape file takes some times and this file is locked during this time (because Open/Close methods) . When other search is executing and file is locked, an error is thrown.
Is any way not to lock a file during search? How can I handle this error?
Thanks,
Igor