Last post Jan 29, 2011 02:42 AM by amitpatel.it
Jan 26, 2011 09:44 AM|dime_f|LINK
i develop asp.net web site and i'm using SqlServer 2005 and XSD as data source.
Because the IIS restart time is 3min and i had sessionstate mode="inProc" they always logged out me for 3 mins.
When i try to use sql server as session mode and i configured propperly database configuration with aspnet_regsql.exe, when i login in the system (using sessions) this exception appear:
Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if
similar serialization is done by the custom session state store in 'Custom' mode.
SerializationException: Type 'dalTableAdapters.adminTableAdapter' in Assembly
how to serialize this adapters, i didn't see any code - it is xml file
Jan 26, 2011 10:26 AM|karthic_85|LINK
If you are adding object of 'dalTableAdapters.adminTableAdapter' to session that class should be serialized
by adding the attribute [Serializable] on top of the class.
else i beleive you can convert that into bytes & store it in the session.PLease brief on
Jan 26, 2011 07:51 PM|sachingusain|LINK
Any object that you try to persist in session object has to be serializable when using state server or sql server as session manager.
Read about "State Serialization and Deserialization" here
Jan 27, 2011 01:05 AM|sovitmittal|LINK
Hi, Session and ViewSatecan only store the serializable data otherwise it will throw the error.
If you want to store the object of the class in Session then make the class serializable first.
Jan 29, 2011 02:42 AM|amitpatel.it|LINK
Can you eloborate what kind of data are you going to store in session ? because session and viewstate are able to store only serialize session so if session object value is not serrialize then system threw this types of error. i.e.e if you store any image
object in session then you are getting this error becase this is binary data and system not allowing to store it in session.
"ASP 2.0" "Session Expire Event"