[dba-VB] DataSet, view deleted rows

Charlotte Foust cfoust at infostatsystems.com
Fri Feb 22 09:49:30 CST 2008


You can also read the data from a deleted DataRow on a field by field
basis, but it's a little different:


If myRow.RowState = DataRowState.Deleted Then
	strVal = myRow.Item("Field1", DataRowVersion.Original).ToString
Else
	strVal = myRow.Field1
End If


We use this when we need to do something like renumber a sequence value
in an array of DataRows where one or more has been deleted.

Charlotte Foust
	

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Thursday, February 21, 2008 11:36 PM
To: dba-vb at databaseadvisors.com
Subject: [dba-VB] DataSet, view deleted rows

Hi all

I browsed this tip from FMS and noticed at the bottom a way to view
deleted rows of a DataSet should you wish to:

  http://www.fmsinc.com/free/NewTips/NET/NETtip56.asp 

'in order to access the values from the deleted row you can create a
filtered dataview

  Debug.WriteLine("Retrieve the values of deleted rows")

  Dim dv As New DataView(dt, "", "", DataViewRowState.Deleted)

  For Each drv As DataRowView In dv
    Debug.WriteLine("ID: " & drv.Item("ID").ToString & _
    ", Name: " & drv.Item("Name").ToString)
  Next

/gustav


_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com





More information about the dba-VB mailing list