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!

DataView.Delete

Deletes a row.

[Visual Basic]
Public Sub Delete( _
   ByVal index As Integer _
)
[C#]
public void Delete(
   int index
);
[C++]
public: void Delete(
   int index
);
[JScript]
public function Delete(
   index : int
);

Parameters

index
The index of the row to delete.

Remarks

After deleting a DataRow, its state changes to DataViewRowState.Deleted.

Example [Visual Basic]

The following example uses the Delete method to delete a row.

[Visual Basic]

Private Sub DeleteRow(dv As DataView, val As String)
   ' Find the given value in the DataView and delete the row.
   Dim i As Integer
   i = dv.Find(val)
   If i = -1 Then
      ' The value wasn't found
      MessageBox.Show("Value not found in primary key column")
      Exit Sub
   Else
      dv.Delete(i)
   End If
End Sub

See Also

DataView Class | DataView Members | System.Data Namespace | DataViewRowState | Find