共用方式為


DataView.AllowDelete 屬性

定義

取得或設定一個值,指示是否允許刪除。

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

屬性值

true,如果允許刪除;否則,。 false

屬性

範例

以下範例在刪除 a 從 中DataView刪除 a DataRow 前檢查該AllowDelete性質。

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

適用於

另請參閱