DataView::Delete Method (Int32)
.NET Framework (current version)
Deletes a row at the specified index.
Assembly: System.Data (in System.Data.dll)
Parameters
- index
-
Type:
System::Int32
The index of the row to delete.
After deleting a DataRow, its state changes to DataViewRowState.Deleted. You can roll back the deletion by calling RejectChanges on the DataTable.
The following example uses the Delete method to delete a row.
Private Sub DeleteRow(view As DataView, val As String) ' Find the given value in the DataView and delete the row. Dim i As Integer = view.Find(val) If i = -1 Then ' The value wasn'table found Console.WriteLine("Value not found in primary key column") Exit Sub Else view.Delete(i) End If End Sub
.NET Framework
Available since 1.1
Available since 1.1
Show: