dataview is not serializable? - session state management

U

uni

Hi,

If I use session state mode=InProc, my session variable
for the dataview object is working fine, but if I change
the mode to StateServer, I got the error message saying:
The type System.Data.DataView in Assembly System.Data,
Version=1.0.3300.0, Culture=neutral, ...... is not marked
as serializable.

How could that be and how can I get around with it?

Any help is appreciated!
uni
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hi,

Store DataSet in the session instead - it is serializable and it contains
the real data while the DataView just sorts/filters them. Re-constructing a
data view on each request can be time-consuming though, so you could also
consider using the ASP .NET cache instead, bearing web farm load balancing
issues in mind.
 
Joined
Aug 31, 2006
Messages
2
Reaction score
0
view code to this

hii
i too was tryin to do the same as ur specified
1. Obtain some data from a remote XML source
2. Convert this to a data set
3. Create a dataview from the above dataset
4. Apply a sort to the dataview
5. Cache this dataview (with sort property set) in the session
the cod eis
DataView dv= new DataView(((DataSet)Session["sess"]).Tables["torder_1"]);
dv.Sort= e.SortExpression.ToString();
Session["sess1"]=dv.Sort;//line 2
ds2=(DataSet) Session["sess1"];
DataGrid1.DataSource=ds2;
DataGrid1.DataBind();
but it gives error at line 2
plzz help me with ur code ..it does not sort the column after i click on it..asap

uni said:
Hi,

If I use session state mode=InProc, my session variable
for the dataview object is working fine, but if I change
the mode to StateServer, I got the error message saying:
The type System.Data.DataView in Assembly System.Data,
Version=1.0.3300.0, Culture=neutral, ...... is not marked
as serializable.

How could that be and how can I get around with it?

Any help is appreciated!
uni
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top