Different behavior between InProc session and SQL Server Session

G

Guest

HOW TO RECREATE
1) Create a Dataset
2) Apply a sort expression to the DefaultView of the first table in the DataSe
Ex: __dataSet.Tables[0].DefaultView.Sort = "EMP_NAME"
3). Save the DataSet in the sessio
Ex: Session["SortedDataSet"] = _dataSet
4) Retrieve the DataSet from the Session and display the data
sDataSet = Session["SortedDataSet"]
ISSUE
If I use InProc session, everything is fine and I get the Sorted dataset back from the session. If I use SQL server session, the dataSet is not retaining the Sort order

We are using .NET 1.1 and C#. Please reply ASAP
Thank
V
 
B

bruce barker

any out of proc session serializes the object to store it and reserializes
on fetch. obviously dataset don't correctly serializes the sort - you will
have to reapply it after fetching the dataset from Session. you could easily
override the default serialization and add this feature to your Datasets
serialzation.

-- bruce (sqlwork.com)


VS said:
HOW TO RECREATE:
1) Create a Dataset.
2) Apply a sort expression to the DefaultView of the first table in the DataSet
Ex: __dataSet.Tables[0].DefaultView.Sort = "EMP_NAME";
3). Save the DataSet in the session
Ex: Session["SortedDataSet"] = _dataSet;
4) Retrieve the DataSet from the Session and display the data.
sDataSet = Session["SortedDataSet"];
ISSUE:
If I use InProc session, everything is fine and I get the Sorted dataset
back from the session. If I use SQL server session, the dataSet is not
retaining the Sort order.
 
J

John Saunders

VS said:
HOW TO RECREATE:
1) Create a Dataset.
2) Apply a sort expression to the DefaultView of the first table in the DataSet
Ex: __dataSet.Tables[0].DefaultView.Sort = "EMP_NAME";
3). Save the DataSet in the session
Ex: Session["SortedDataSet"] = _dataSet;
4) Retrieve the DataSet from the Session and display the data.
sDataSet = Session["SortedDataSet"];

DataSets do not contain sorted data. Save the DataView instead.
 

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,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top