ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Editing Namespace / EditOperation.IEditContext Interface / Invalidate Method / Invalidate(Dataset) Method
The Dataset to invalidate.
Example

In This Topic
    Invalidate(Dataset) Method
    In This Topic
    Invalidates all features/rows in a dataset.
    Syntax
    void Invalidate( 
       Dataset dataset
    )
    Overloads Sub Invalidate( _
       ByVal dataset As Dataset _
    ) 

    Parameters

    dataset
    The Dataset to invalidate.
    Example
    Creating a Row
    public async Task CreatingARow()
    {
      string message = String.Empty;
      bool creationResult = false;
      EditOperation editOperation = new EditOperation();
    
      await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
      {
    
        using (Geodatabase geodatabase = new Geodatabase(
          new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde"))))
        using (Table enterpriseTable = geodatabase.OpenDataset<Table>("LocalGovernment.GDB.piCIPCost"))
        {
    
          //var geodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(uri)) for a File GDB
          //
          //var shapeFileConnPath = new FileSystemConnectionPath(uri, FileSystemDatastoreType.Shapefile);
          //var shapefile = new FileSystemDatastore(shapeFileConnPath);
          //var table = shapefile.OpenDataset<Table>(strShapeFileName); for a Shape file
    
          //declare the callback here. We are not executing it .yet.
          editOperation.Callback(context =>
          {
            TableDefinition tableDefinition = enterpriseTable.GetDefinition();
            int assetNameIndex = tableDefinition.FindField("ASSETNA");
    
            using (RowBuffer rowBuffer = enterpriseTable.CreateRowBuffer())
            {
              // Either the field index or the field name can be used in the indexer.
              rowBuffer[assetNameIndex] = "wMain";
              rowBuffer["COST"] = 700;
              rowBuffer["ACTION"] = "Open Cut";
    
              // subtype value for "Abandon".
              rowBuffer[tableDefinition.GetSubtypeField()] = 3;
    
              using (Row row = enterpriseTable.CreateRow(rowBuffer))
              {
                // To Indicate that the attribute table has to be updated.
                context.Invalidate(row);
              }
            }
          }, enterpriseTable);
    
          try
          {
            creationResult = editOperation.Execute();
            if (!creationResult) message = editOperation.ErrorMessage;
          }
          catch (GeodatabaseException exObj)
          {
            message = exObj.Message;
          }
        }
      });
    
      if (!string.IsNullOrEmpty(message))
        MessageBox.Show(message);
    
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also