asp.net.ph

DataView.Delete Method

System.Data Namespace   DataView Class


Deletes a row at the specified index.

[ VB ]
Public Sub Delete ( _
   ByVal index As Integer _
)

[ C# ]
void Delete (
   int index
);

[ C++ ]
public: void Delete (
   int index
);

[ JScript ]
public function Delete (
   index : int
);

Parameters

index
The index of the row to delete.

Remarks

After deleting a DataRow, its state changes to DataViewRowState.Deleted. You can roll back the deletion by calling RejectChanges on the DataTable.

Example

The following example uses the Delete method to delete a row.

private void DeleteRow ( DataView dv, String val ) {
   // Find the given value in the DataView and delete the row.
   int i = dv.Find ( val );
   if ( i > -1 )
      dv.Delete ( i );
   else {
      // the value wasn't found
      Response.Write ( "Value not found in primary key column" );
   }
}
  C# VB

See Also

DataView Members   DataViewRowState   Find Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph