Advantage .NET Data Provider
Removes deleted records and re-indexes the table.
public void PackTable();
PackTable will remove all deleted records from the specified table. Internal fragmentation in memo files will also be eliminated. The table is then re-indexed. If a progress callback function is available, it will be called during the reindexing. The indexes must be opened during the pack or they will become logically invalid. AdsConnection.CloseCachedTables This operation requires exclusive access to the table, specified in theConnectionString (Shared=FALSE).
// Set shared=false so the table will be opened exclusively
conn = new AdsConnection( @"data source=c:\data; shared=false" );
// Create a command that specifies just the table name (not an
// SQL statement).
cmd = new AdsCommand( "testdata", conn );
// open it as a table (not a cursor)
cmd.CommandType = CommandType.TableDirect;
rdr = cmd.ExecuteExtendedReader();
// remove deleted records from the table.
catch ( Exception ex )
Console.WriteLine( ex.ToString() );