Deletes a row.
[Visual Basic] Public Sub Delete( _ ByVal index As Integer _ ) [C#] public void Delete( int index ); [C++] public: void Delete( int index ); [JScript] public function Delete( index : int );
After deleting a DataRow, its state changes to DataViewRowState.Deleted.
The following example uses the Delete method to delete a row.
[Visual Basic]
Private Sub DeleteRow(dv As DataView, val As String) ' Find the given value in the DataView and delete the row. Dim i As Integer i = dv.Find(val) If i = -1 Then ' The value wasn't found MessageBox.Show("Value not found in primary key column") Exit Sub Else dv.Delete(i) End If End Sub
DataView Class | DataView Members | System.Data Namespace | DataViewRowState | Find