NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataRow.Delete

Deletes the row.

[Visual Basic]
Public Sub Delete()
[C#]
public void Delete();
[C++]
public: void Delete();
[JScript]
public function Delete();

Exceptions

Exception Type Condition
RowNotInTableException The row doesn't belong to the table.
DeletedRowInaccessibleException The row has already been deleted.

Remarks

If the RowState of the row is New, the row will be removed from the table.

The DataViewRowState becomes Deleted after using the Delete method.

Example [Visual Basic]

The following example deletes the row in a System.WinForms.DataGrid control with the focus.

[Visual Basic]

Private Sub DeleteRow()
   Dim t As DataTable
   t = DataSet1.Tables(0)
   Dim row As DataRow
   row = t.Rows(DataGrid1.CurrentCell.RowNumber)
   row.Delete
End Sub

See Also

DataRow Class | DataRow Members | System.Data Namespace