This document is archived and information here might be outdated.  Recommended version.


ITable.UpdateSearchedRows Method (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (GeoDatabase)  

ITable.UpdateSearchedRows Method

Update the Rows in the database selected by the specified query.

[Visual Basic .NET]
Public Sub UpdateSearchedRows ( _
    ByVal QueryFilter As IQueryFilter, _
    ByVal buffer As IRowBuffer _
)
[C#]
public void UpdateSearchedRows (
    IQueryFilter QueryFilter,
    IRowBuffer buffer
);
[C++]
HRESULT UpdateSearchedRows(
  IQueryFilter* QueryFilter,
  IRowBuffer* buffer
);
[C++]

Parameters QueryFilter [in]
QueryFilter is a parameter of type IQueryFilter* buffer [in]
buffer is a parameter of type IRowBuffer*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

This method will edit the rows matching the query filter's constraints.  The values in each row will be replaced with the corresponding field's value in the provided row buffer.  The fields being edited should be specified in the query filter's SubFields property.  If the row buffer contains null values, and the SubFields property is not properly set, the row's values will be overwritten with the row buffer's null values.

[C#]

// Updates the value of a table's TERM field to city, if its 1996 population is

// greater than or equal to 10,000.

public void UpdateTerm(ITable table)

{

    // Build the query filter.

    IQueryFilter queryFilter = new QueryFilterClass();

    queryFilter.WhereClause = "Pop1996 >= 10000";

    queryFilter.SubFields = "TERM";

 

    // Find the position of the TERM field in the table.

    int termPosition=table.FindField("TERM");

 

    // Build the row buffer to store the new value(s).

    IRowBuffer rowBuffer=table.CreateRowBuffer();

    rowBuffer.set_Value(termPosition, "City");

 

    // Update the matching rows.

    table.UpdateSearchedRows(queryFilter, rowBuffer);

}

See Also

ITable Interface

.NET Related Topics

Updating features