DataView.AllowDelete 屬性

定義

設定或取得值,表示是否允許刪除。Sets or gets a value that indicates whether deletes are allowed.

public:
 property bool AllowDelete { bool get(); void set(bool value); };
[System.Data.DataSysDescription("DataViewAllowDeleteDescr")]
public bool AllowDelete { get; set; }
member this.AllowDelete : bool with get, set
Public Property AllowDelete As Boolean

屬性值

如果允許刪除,則為 true;否則為 falsetrue, if deletes are allowed; otherwise, false.

屬性

範例

下列範例會先檢查AllowDelete屬性, 然後再DataRow從中DataView刪除。The following example checks the AllowDelete property before deleting a DataRow from a DataView.

private void CheckAllowDelete(DataRow rowToDelete)
{
    DataView view = new DataView(DataSet1.Tables["Suppliers"]);
    if (view.AllowDelete)
        rowToDelete.Delete();
}
Private Sub CheckAllowDelete(rowToDelete As DataRow)
    Dim view As New DataView(DataSet1.Tables("Suppliers"))
    If view.AllowDelete Then
    rowToDelete.Delete()
    End If
End Sub

適用於

另請參閱