Different behavior between InProc session and SQL Server Session

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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.
 
Back
Top