| Exception | Description |
|---|---|
| System.NotSupportedException | This table/feature does not support this operation. For example, it is from a joined table. |
| ArcGIS.Core.Data.Exceptions.GeodatabaseException | A geodatabase-related exception has occurred. |
{
await QueuedTask.Run(() =>
{
string message = String.Empty;
bool deletionResult = false;
using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde"))))
using (Table enterpriseTable = geodatabase.OpenDataset<Table>("LocalGovernment.GDB.piCIPCost"))
{
EditOperation editOperation = new EditOperation();
editOperation.Callback(context =>
{
QueryFilter openCutFilter = new QueryFilter { WhereClause = "ACTION = 'Open Cut'" };
using (RowCursor rowCursor = enterpriseTable.Search(openCutFilter, false))
{
while (rowCursor.MoveNext())
{
using (Row row = rowCursor.Current)
{
// In order to update the Map and/or the attribute table. Has to be called before the delete.
context.Invalidate(row);
row.Delete();
}
}
}
}, enterpriseTable);
try
{
deletionResult = editOperation.Execute();
if (!deletionResult) message = editOperation.ErrorMessage;
}
catch (GeodatabaseException exObj)
{
message = exObj.Message;
}
}
if (!string.IsNullOrEmpty(message))
Debug.WriteLine(message);
});
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)