How to delete an existing ITable in inMemoryWorkspace

Discussion created by jpossin on Dec 18, 2012
Latest reply on Dec 19, 2012 by APoling
Hi together!

I'm trying to delete an ITable in an inMemoryWorkspace but the following code doesn't work:

 Public Sub deleteTableInWorkspace(ByVal pTable As ITable)
        Dim pDataset As IDataset
        pDataset = pTable
        CType(managerInMemoryWorkspace, IFeatureWorkspaceManage).DeleteByName(pDataset.FullName)
    End Sub

The code doesn't throw an exception but later I try to generate a new ITable with the same name:

 Dim pTable As ITable = workspace.CreateTable(ITableName, pFields, Nothing, Nothing, "")

Now I get the following exception:

"Exception from HRESULT: 0x80040353"

I debugged my code and recognize that the IName object from my generated ITable is empty. Is this the problem why the deleteTableInWorkspace method doesn't work? But how can i fill the IName object from the Tbale with values?