473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

SQL Session State Deserialization ?

WJ
I have problem in using "Deserialization" method to work with SQL Session
State. The session state data was recorded properly to MS/SQL Server
ASPState by a web application. I then attempted to read the session data
back from the SQL server using DataSet. Then call "Deserialize" to reveal
the session class. I got the following error:

"BinaryFormatter Version incompatibility. Expected Version 1.0. Received
Version 623915045.807743536."

Below is the code snippet:

======================
using System; //Sesison Class

namespace wSS
{
[Serializable()]
public class cSS
{
public string FirstName="";
public string LastName="";
public DateTime DOB;

public cSS()
{
}
}
}
=======================

...some codes here to read ASPState data into DataSet called myDS

byte[]b1=new byte[0]; //slot to hold raw data in ms/sql varbinary format
byte[]b2=new byte[0]; //slot to hold raw data in Text (string) format

b1=(byte[])myDS.Tables[0].Rows[0]["SessionItemShort"];
string s=Server.UrlEncode(Encoding.ASCII.GetString(b1));

b2=Encoding.ASCII.GetBytes(s);

//This displayed the correct content of the session class
TextBoxTraceLog.Text+="Check Point#7 - mySQLss="+s+
Environment.NewLine+Environment.NewLine;

MemoryStream ms=new MemoryStream(b2);

BinaryFormatter bf=new BinaryFormatter();
cSS cs=null; //see session class record above

try
{
cs=(cSS)bf.Deserialize(ms); //Here is the bomb
}
catch(Exception be)
{
TextBoxTraceLog.Text+="Check Point#8 - ERROR. Yep,"+
"it is goofed right here-> "+be.Message;

ms.Close();
return;
}

ms.Close();
**********************

PS: If you wish to see the complete sample program, please reply to this
message so that I can attach a 13KB zip file for you to look at.

Thanks for your help,

John

Jul 22 '05 #1
2 3488
Have you found a fix for this?

Aug 3 '05 #2
WJ
No Randy. I donot think it is possible. Only the application that builds the
SS would be compatible and able to reveal the class.

John

<ra********@fnf.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Have you found a fix for this?

Aug 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jim Douglas | last post by:
I am starting the analysis and design on how we are going to handle session data. We are on a large web-farm which limits our solutions. The best solution is persisting to MS SQLServer but I'm not...
2
by: genc_ymeri | last post by:
Hi, Well, I'm looking around for another opinion. We have two webservers, the legacy one writen in ASP and the new one in ASP.Net. Once a user logs in the ASP.Net web app, the session of the...
8
by: karahan celikel | last post by:
I realized that when SqlServer mode is used for session management Session_End event is not fired in global.asax. What can I do if I want to do something when a user's session end? Thanks
13
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data...
4
by: tshad | last post by:
I am running with Sql Server and am curious if I should use in-process, State Server, or SQL Server. By default, I assume I am using in-process (I could be wrong here, however). I am not...
1
by: Seetha J | last post by:
I work on a website where users can apply for different types of loans. Depending on the type of loan we store various sets of data in Session state which is maintained in SQL Server. If the user...
3
by: WJ | last post by:
I have problem in using "Deserialization" method to work with SQL Session State. The session state data was recorded properly to MS/SQL Server ASPState by a web application. I then attempted to...
1
by: Tim | last post by:
Could anyone tell me what this means and how do I correct it. Any suggestions? Thanks! Tim Richardson IT Developer and Consultant www.paladin3d.com Unable to serialize the session state. In...
3
by: Moe Sisko | last post by:
Using dotnet 2.0 sp1, I've got ASP.NET session state working ok in SQLServer mode, but the sessions never seem to expire. e.g if I add a timeout attribute like so : <sessionState...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.