DataView.Delete(Int32) DataView.Delete(Int32) DataView.Delete(Int32) DataView.Delete(Int32) Method

Definizione

Elimina una riga in corrispondenza dell'indice specificato.Deletes a row at the specified index.

public:
 void Delete(int index);
public void Delete (int index);
member this.Delete : int -> unit
Public Sub Delete (index As Integer)

Parametri

index
Int32 Int32 Int32 Int32

Indice della riga da eliminare.The index of the row to delete.

Esempi

Nell'esempio seguente viene usato Delete il metodo per eliminare una riga.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

Commenti

Dopo l'eliminazione DataRowdi, il relativo stato DataViewRowState.Deletedviene modificato in.After deleting a DataRow, its state changes to DataViewRowState.Deleted. È possibile eseguire il rollback dell'eliminazione RejectChanges chiamando DataTablesu.You can roll back the deletion by calling RejectChanges on the DataTable.

Si applica a

Vedi anche