Deletes the current record.


Namespace: ActualMap
Assembly: ActualMap (in ActualMap.dll)

Syntax

Visual Basic (Declaration)
Public Sub Delete()
C#
public void Delete()
C++
public:
 void Delete() sealed 
J#
public void Delete()
JScript
public  function Delete()

Return Value

The method returns a Recordset object.

Exceptions

Exception TypeCondition
ExceptionThrown when an error occurs.

Remarks

This method supports spatial database layers derived from the SpatialDatabaseLayer.

The database table must have a primary key, otherwise the record will not be deleted.

After deleting the current record, the deleted record remains current until you move to a different record. Retrieving field values from the deleted record generates an error.

Example

 Copy Code
SqlServerLayer sqlLayer = new SqlServerLayer(connString, "parcels", "GEOMETRY");
layer.FieldList = "ID, TYPE,OWNER";
layer.DataType = SqlServerDataType.Geometry;

Layer layer = map.AddLayer(sqlLayer);
layer.EnablePassthroughQuery = true;

Recordset rs = layer.SearchExpression("ID = 2403370");
if (!rs.EOF)
{
    rs.Delete();
}

See Also