SQL Server Session Management Mode in .NET
page 6 of 8
by Sandeep Acharya
Feedback
Average Rating: 
Views (Total / Last 10 Days): 34151/ 123

How to Exploit Serialization and De-serialization for SQL Server Session Management

As we have already discussed at the beginning of this article, SQL Server Session management requires the Serialization and De-Serialization process to store the session values in the Database. And this requirement becomes more prominent when we will try to dump an object directly to the Session. Because the integers, strings, etc. can be directly stored/retrieved to and from the Session (as it goes through the internal conversion actually), for objects we need to do the process by our own.

For that we need to exploit the Serialization and De-Serialization process. Let us see the example doing the same below.

Listing 4

Dim oDataDescription As New DataDescription(0, "ZERO")
'Serializes the oDataDescription object and stores the serialized data in Session
Session.Add("test", SerializeData(oDataDescription))
'De-serializes the Data from the Session 
'and brings the object into its original shape.
oDataDescription = DeSerializeData(Session.Item("test"))
Response.Write("Data: " & oDataDescription.Data & "<br>")
Response.Write("Description: " & oDataDescription.Description)

View Entire Article

User Comments

Title: SerializeData list arrays   
Name: Sachin Kulkarni
Date: 2009-05-18 5:05:50 AM
Comment:
Hi,
I read the article it is very good information. I have just one question does the SerializeData function Serialize the system.collection objects too. As you are using the .Net Serialize method.
If not how can I do it?

Thanks in advance,
sachin
Title: SQL Server Session Management Mode in .NET   
Name: Ravikumar Bhuvanagiri
Date: 2009-02-13 11:41:18 AM
Comment:
This Article is very usefull.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-05-18 1:55:01 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search