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

De-Serialization

Deserialization is the process of using the serialized state information to regain the object from the serialized shape to its original shape.

So, it is basically the reverse process of the Serialization. (The name also suggests De-Serialization)

The code below can be used for the De-serialization process.

Listing 3

Public Function DeSerializeData(ByVal oStream As System.IO.MemoryStream) _
As Object
  Dim oFormatter As New _
    System.Runtime.Serialization.Formatters.Binary.BinaryFormatter()
  Dim oReturnObject As Object
  oStream.Position = 0
  oReturnObject = oFormatter.Deserialize(oStream)
  Return oReturnObject
End Function

The function DeSerializeData De-serializes a MemoryStream (which has been obtained by Serializing a Serializable object).

Here we need to add an extra line to seek the position of the MemoryStream to ZERO (0).


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-11 11:59:26 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search