BUG?:using dataset and ReadXML in postback

F

Felipe Blin

Hi,
I have found a problem when I try to reload a Class with a Dataset inside .
The problem is that The dataset lost the rowstate and fools itself thinking
that all the rows are new. So when I do the update it try to reinsert new
and old rows.

Any idea?
Thank for the help

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
....
If Page.IsPostBack Then
Dim sr As System.IO.StringReader = New
System.IO.StringReader(CType(Session("Indi"), String))
Me.Indi.ReadXml(sr)
sr = New System.IO.StringReader(CType(Session("users"), String))
Me.users.ReadXml(sr)
SetGridDataSources()
Me.loadChangesInGrid()
else
...
end if
end sub
.....
Private Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Unload
Dim sw As System.IO.StringWriter = New System.IO.StringWriter
Indi.WriteXml(sw)
Session("Indi") = sw.ToString
End Sub

Atte.
Felipe Blin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top