AnsweredAssumed Answered

ArcMap retains fields of removed Table.

Question asked by Hornbydd on Mar 14, 2013
Latest reply on Mar 15, 2013 by Hornbydd
All,

I have developed an AddIn for ArcMap 10.1 using VB .net 2010.

My tool writes data it creates to a dBase file which gets loaded into the TOC. During processing the tool can create up to 25 fields.

Sometimes a user will need to rebuild this table with its initial set of 3 fields (by selecting a button on toolbar).

When the user clicks on the create table button my code searches for the table in the TOC and removes it with the following code:

 pStandAloneTableCollection.RemoveStandaloneTable(pStandAloneTable) pMXDocument.UpdateContents()


The code then continues by deleting the existing dBase file and then recreates with the default set of 3 fields. This all works fine. The table is loaded back into the TOC with the following code:

pStandAloneTable = New StandaloneTableClass pStandAloneTable.Table = pTable pStandAloneTable.Name = Me.TextBox1.Text pStandAloneTableCollection.AddStandaloneTable(pStandAloneTable) pMXDocument.UpdateContents()


If I then go to the Table in ArcMap and open it I see all the previous fields (with zero values) and not an attribute table with just 3 fields. It's as if ArcMap has held onto the schema of the table it had removed, any ideas on how to force a refresh?

Duncan

Outcomes