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!

DeletedRowInaccessibleException Class

Represents the exception that is thrown when an action is attempted on a DataRow that has been deleted.

Object
   Exception
      SystemException
         DeletedRowInaccessibleException

[Visual Basic]
Public Class DeletedRowInaccessibleException
   Inherits SystemException
[C#]
public class DeletedRowInaccessibleException : SystemException
[C++]
public __gc class DeletedRowInaccessibleException : public
   SystemException
[JScript]
public class DeletedRowInaccessibleException extends
   SystemException

Remarks

To delete a DataRow, use the DataRow class's Delete method. Once you have deleted a row with the method, any attempts to manipulate it will generate the DeletedRowInaccessibleException.

The DeletedRowInaccessibleException is thrown when using one of the following properties or methods that attempt to get or set the value of a deleted DataRow:

Use the DataRow class's RowState to determine if a row has been deleted.

Requirements

Namespace: System.Data

Assembly: System.Data.dll

Example [Visual Basic]

The following example deletes a DataRow from a DataTable. A subsequent attempt to read a value from the deleted row causes the DeletedRowInaccessibleException to be thrown.

[Visual Basic]

Private Sub DeleteRow()
   ' Create DataTable with one DataColumn.
   Dim t As New DataTable
   Dim dc As New DataColumn
   Set dc.DataType = system.Type.GetType("System.Int32")
   t.Columns.Add dc
   Dim i As Integer
   ' Add 10 rows.
   Dim r As DataRow
   For i = 0 To 9
      Set r = t.NewRow
      r(0) = i
      t.Rows.Add r
   Next
   t.AcceptChanges
   Try
      Dim removedRow As DataRow
      Set removedRow = t.Rows(9)
      removedRow.Delete
      Debug.Print removedRow.RowState
      Debug.Print removedRow(0)
      removedRow.AcceptChanges
      Catch delRowErr As System.Data.DeletedRowInaccessibleException
      Debug.Print "DeletedRowInaccessibleException", delRowErr.Message
    Finally
      Debug.Print "finished"
    End Try
End Sub

See Also

DeletedRowInaccessibleException Members | System.Data Namespace | BeginEdit | DataRow | DataRowState | Delete | Item | ItemArray | RowState