Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Another SessionState Question
Message
De
12/03/2003 20:57:05
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Another SessionState Question
Divers
Thread ID:
00765224
Message ID:
00765224
Vues:
54
I'm getting different behavior when saving a DataSet to SessionState ... differences between using the default in-process Session vs saving Session to SQL Server.

When using a regular DataSet, all seems to work just fine. But, when using a Typed DataSet (which all our DataSets are), it doesn't work for SQL Sessions but works fine for the in-memory Sessions. Any idea why? I get an error about deserializing the DataSet.

Here's how I was doing this (where this.oData is a Typed DataSet):
// to save to Session
Session["oData"] = this.oData;

// to retrieve from Session
this.oData = (MyDataSet)Session["oData"];
I've worked around it for now by serializing the DataSet to XML and saving the XML string as the Session variable and then getting it back into the DataSet with ReadXML() (but I may run into other problems with that ... not sure yet how this will affect deleted rows ... I'm still researching this).

Anyone know why the behavior is different? Why should it not work just because I'm saving the Session variable to SQL? Anything else I need to do differently?

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform