I create a dataview from a datatable in which I use to send to an outside object accepting a dataview as a parameter.
The process goes as such.
Psudocode:
Open main datatable
for each tablerow in datatabletable
create new dataview
set dataview row filter to tablerow item(x)
create new object(dataview)
do stuff w/object...
destroy dataview
next
when the loop comes back in for the second time the rowfilter is changed successfully but the data within isnt
I loop through a table for the values to set the row filter
The row filter is successfully changed but the data in the dataview is not changed. This doesnt make since because I destroy and recreate the dv on every pass. It seems like a am missing a step in which i call some kind of requerying method. Any help is appreciated.
CODE
For Each drow As DataRow In xmlDs.Tables(2).Rows
If drow("eventid") <> EventHold Then
dview = New DataView(xmlDs.Tables(2))
Dim a As String = drow("eventid")
dview.RowFilter = "eventid = '" & drow("eventid") & "'"
dview.Sort = "formctl"
dview.RowStateFilter = DataViewRowState.Added
a = dview.Table.Rows(0).Item("eventid")
!!!!!!!!!When I Query for "a" I get the old value!!!!!!!!!!
propEvent = New clsPropEvent(dview)
loadControl(propEvent.EventControl)
dview.Dispose()
dview = Nothing
propEvent = Nothing
EventHold = drow("eventid")
End If
The process goes as such.
Psudocode:
Open main datatable
for each tablerow in datatabletable
create new dataview
set dataview row filter to tablerow item(x)
create new object(dataview)
do stuff w/object...
destroy dataview
next
when the loop comes back in for the second time the rowfilter is changed successfully but the data within isnt
I loop through a table for the values to set the row filter
The row filter is successfully changed but the data in the dataview is not changed. This doesnt make since because I destroy and recreate the dv on every pass. It seems like a am missing a step in which i call some kind of requerying method. Any help is appreciated.
CODE
For Each drow As DataRow In xmlDs.Tables(2).Rows
If drow("eventid") <> EventHold Then
dview = New DataView(xmlDs.Tables(2))
Dim a As String = drow("eventid")
dview.RowFilter = "eventid = '" & drow("eventid") & "'"
dview.Sort = "formctl"
dview.RowStateFilter = DataViewRowState.Added
a = dview.Table.Rows(0).Item("eventid")
!!!!!!!!!When I Query for "a" I get the old value!!!!!!!!!!
propEvent = New clsPropEvent(dview)
loadControl(propEvent.EventControl)
dview.Dispose()
dview = Nothing
propEvent = Nothing
EventHold = drow("eventid")
End If