DataView.Delete(Int32) 메서드

정의

지정된 인덱스에서 행을 삭제합니다.

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

매개 변수

index
Int32

삭제할 행의 인덱스입니다.

예제

다음 예제에서는 메서드를 Delete 사용하여 행을 삭제합니다.

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

설명

삭제한 DataRow후에는 상태가 .로 변경합니다 DataViewRowState.Deleted. 를 호출 RejectChanges 하여 삭제를 롤백할 DataTable수 있습니다.

적용 대상

추가 정보