Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Another SessionState Question
Message
De
13/03/2003 10:37:44
 
 
À
13/03/2003 02:06:12
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00765224
Message ID:
00765378
Vues:
19
The error message I'm getting is: "The constructor to deserialize an object of type MyNamespace.MyTypedDataSet was not found."

It doesn't happen until I post back ... when first displaying the page, I get data from SQL with a SP and save it to my Typed DataSet, I save that data to a session variable, then I retrieve the data from the session variable (I was testing timing issues, how long it took to retrieve/save data in various ways). That all seems to work just fine (note that I can successfully retrieve the information from the Session variable at this point ... I'm guessing it's probably because it's not been serialized to SQL yet). But, once I post back, I get this error before it even hits the Page Load.

>>Have you looked at the data stored in SQL Server after you save the session state?<

Have you? It's binary ... <g>


~~Bonnie


>Bonnie,
>
>Are you getting an error message when trying to restore the dataset from the session data? My guess is that you are running into a namespace or encoding problem.
>
>Have you looked at the data stored in SQL Server after you save the session state?
>
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform