Dataview is not serializable

R

Raghavendra Tilve

Unable to serialize the session state. Please note that non-serializable
objects or MarshalByRef objects are not permitted when session state mode is
'StateServer' or 'SQLServer'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Unable to serialize the session
state. Please note that non-serializable objects or MarshalByRef objects are
not permitted when session state mode is 'StateServer' or 'SQLServer'.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:
Hi,

I am getting the error when i do SessionState SQlserver inn web.config



[SerializationException: The type System.Data.DataView in Assembly
System.Data, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 is not marked as serializable.]

System.Runtime.Serialization.FormatterServices.InternalGetSerializableMember
s(RuntimeType type, Boolean excludeNonSerializable) +868

System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type
type, StreamingContext context) +300

System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInf
o() +103

System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize
(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context,
SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter) +493

System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Obj
ect obj, ISurrogateSelector surrogateSelector, StreamingContext context,
SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter) +48

System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjec
tInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) +515

System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object
graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +738

System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Str
eam serializationStream, Object graph, Header[] headers, Boolean fCheck)
+136

System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Str
eam serializationStream, Object graph) +13
System.Web.Util.AltSerialization.WriteValueToStream(Object value,
BinaryWriter writer)

[HttpException (0x80004005): Unable to serialize the session state. Please
note that non-serializable objects or MarshalByRef objects are not permitted
when session state mode is 'StateServer' or 'SQLServer'.]
System.Web.Util.AltSerialization.WriteValueToStream(Object value,
BinaryWriter writer)
System.Web.SessionState.SessionDictionary.Serialize(BinaryWriter writer)
System.Web.SessionState.StateClientManager.Serialize(SessionStateItem
item, Stream stream)

System.Web.SessionState.SqlStateClientManager.System.Web.SessionState.IState
ClientManager.Set(String id, SessionStateItem item, Boolean inStorage)
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source,
EventArgs eventArgs)
System.Web.SessionState.SessionStateModule.OnEndRequest(Object source,
EventArgs eventArgs)

System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.
Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
 
C

Cor Ligthert

Raghavendra,

What do you want to serialize from a dataview, it holds no data, it is a
view on a datatable.

Cor
 
R

Raghavendra Tilve

Hi,

my dataview its acting like property within a class which is serailized by
using [Serializable]

public virtual DataView DataView
{
get
{
DataView t_DataView = m_DataTable.DefaultView;
if(m_Sort!=null)
{
t_DataView.Sort = this.m_Sort.SortExpression;
}
return t_DataView ;
}
set
{
m_DataTable = value.Table;
}
}
 
R

Raghavendra Tilve

Cor

i get the error
[SerializationException: The type System.Data.DataView in Assembly
System.Data, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 is not marked as serializable.]


Raghavendra
 

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

Top