Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataView.AllowDelete Property

Sets or gets a value indicating whether deletes are allowed.

[Visual Basic]
Public Property AllowDelete As Boolean
[C#]
public bool AllowDelete {get; set;}
[C++]
public: __property bool get_AllowDelete();
public: __property void set_AllowDelete(bool);
[JScript]
public function get AllowDelete() : Boolean;
public function set AllowDelete(Boolean);

Property Value

true, if deletes are allowed; otherwise, false.

Example

[Visual Basic, C#, C++] The following example checks the AllowDelete property before deleting a DataRow from a DataView.

[Visual Basic] 
Private Sub CheckAllowDelete(rowToDelete As DataRow)
   Dim dv As DataView = New DataView(DataSet1.Tables("Suppliers"))
   If dv.AllowDelete Then
      rowToDelete.Delete()
   End If
End Sub

[C#] 
private void CheckAllowDelete(DataRow rowToDelete)
{
   DataView dv = new DataView(DataSet1.Tables["Suppliers"]);
   if (dv.AllowDelete)
      rowToDelete.Delete();
}

[C++] 
private:
 void CheckAllowDelete(DataRow* rowToDelete)
 {
    DataView* dv = new DataView(DataSet1->Tables->Item[S"Suppliers"]);
    if (dv->AllowDelete)
       rowToDelete->Delete();
 }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DataView Class | DataView Members | System.Data Namespace

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft