DataSet inconsistent in behavior in different session state manage

G

Guest

Hi Everyone,

I've declared a datatable out of my typed dataset stored in session and add
a new row to it. When state management is set to InProc and I modified the
declared dataable, the changes reflect to the dataset. But when the session
is OutProc (using SQL) , the changes doesnt reflect. For e.g.

Sub Page_Load
myDataSet AS myTypedDataSet

If Not IsPostBack Then
Populate(myDataSet)
Session("myDataSet") = myDataSet
Else
myDataSet = CType(Session("myDataSet"), myTypedDataSet)

Dim myDataTable AS myDataSet.Table1
Dim myNewRow AS myDataSet.Table1Row

myNewRow = myDataTable.newTable1Row
myNewRow.Column1 = 1
myDataTable.AddTable1Row(myNewRow)

Response.Write(myDataTable.Rows.Count)
Response.Write(myDataSet.Table1.Rows.Count)
End If
End Sub

The dataset was modified when the pageloads and I put it the dataset in
session. When postback I retrieve the dataset in session and modify it, too.
Now here's where the problem occurs. If its InProc, any changes to
myDataTable reflects in myDataSet.Table1. But if its OutProc, the changes in
myDataTable doesnt reflect in myDataSet.Table1. I dont need to update the
session object

If the session is InProc, both Response.Write will return 1. But if the
session is OutProc, the first Response.Write will return 1 but the second
will return 0.

It seems the my changes on myDataTable doesnt get updated in the dataset.
How can I make it beahve like in InProc?
 

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

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,219
Latest member
KristieKoh

Latest Threads

Top