Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > How to use Serialization.

Reply
Thread Tools

How to use Serialization.

 
 
Sangeetha Nagaraj
Guest
Posts: n/a
 
      07-16-2004
I am developing a project for a courier service. My Manager suggested to use serialization.
I dont know anything about serialization in VB.NET. Can anyone give me some details about Serialization and how to use it practically...
--
Rgds,
Sang
 
Reply With Quote
 
 
 
 
John Paul. A
Guest
Posts: n/a
 
      07-16-2004
Hi Sang,
Youe manager has given a good suggestion. Here's the details.

Serialization is the process by which objects or values are converted into a format that can be persisted or transported. Serialization allows you to save the state of objects from memory to a storage medium such as files. You can also use serialization to transport objects and values across the network. To read the state of the objects or values that you persist or transport using serialization, you use another process called deserialization. Deserialization is complementary to serialization. The .NET Framework supports two types of serialization, binary serialization and XML serialization.

Binary serialization converts the state of an object by writing the public and private fields, name of the class, and the assembly containing the class into a stream of bytes. To make your objects serializable, you need to mark the class with the Serializable attribute.

For more details.. See this...

http://msdn.microsoft.com/library/de...bjserializ.asp

http://www.15seconds.com/issue/020903.htm


--
Thanks & Regards,
John Paul. A
MCP


"Sangeetha Nagaraj" wrote:

> I am developing a project for a courier service. My Manager suggested to use serialization.
> I dont know anything about serialization in VB.NET. Can anyone give me some details about Serialization and how to use it practically...
> --
> Rgds,
> Sang

 
Reply With Quote
 
 
 
 
John Paul. A
Guest
Posts: n/a
 
      07-16-2004
Here's a sample and a simple code, you asked..

Imports System.IO
Imports System.Runtime.Serialization.Formatters.Binary

Public Class SerializeDemo
Public Shared Sub Main()
Dim obj as New MySerializableClass()
obj.n1 = 10
obj.s1 = "Hello"
Dim stream As New FileStream("MyFile.dat", FileMode.Create)
Dim formatter As New BinaryFormatter()
formatter.Serialize(stream, obj)
End Sub
End Class


==========


Imports System.IO
Imports System.Xml.Serialization

Public Class SerializeDemo
Public Shared Sub Main()
Dim obj As New MySerializableClass()
obj.n1 = 10
obj.s1 = "Hello"
Dim stream As New FileStream("MyFile.xml", FileMode.Create)
Dim formatter As New XmlSerializer(GetType(MySerializableClass))
formatter.Serialize(stream, obj)
End Sub
End Class


--
Thanks & Regards,
John Paul. A
MCP


"Sangeetha Nagaraj" wrote:

> The links are really useful.
> Can you give me a sample and a simple code.
> --
> Rgds,
> Sang
>
>
> "John Paul. A" wrote:
>
> > Hi Sang,
> > Youe manager has given a good suggestion. Here's the details.
> >
> > Serialization is the process by which objects or values are converted into a format that can be persisted or transported. Serialization allows you to save the state of objects from memory to a storage medium such as files. You can also use serialization to transport objects and values across the network. To read the state of the objects or values that you persist or transport using serialization, you use another process called deserialization. Deserialization is complementary to serialization. The .NET Framework supports two types of serialization, binary serialization and XML serialization.
> >
> > Binary serialization converts the state of an object by writing the public and private fields, name of the class, and the assembly containing the class into a stream of bytes. To make your objects serializable, you need to mark the class with the Serializable attribute.
> >
> > For more details.. See this...
> >
> > http://msdn.microsoft.com/library/de...bjserializ.asp
> >
> > http://www.15seconds.com/issue/020903.htm
> >
> >
> > --
> > Thanks & Regards,
> > John Paul. A
> > MCP
> >
> >
> > "Sangeetha Nagaraj" wrote:
> >
> > > I am developing a project for a courier service. My Manager suggested to use serialization.
> > > I dont know anything about serialization in VB.NET. Can anyone give me some details about Serialization and how to use it practically...
> > > --
> > > Rgds,
> > > Sang

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Could not use ''; file already in use. M K ASP .Net 11 04-09-2008 11:35 AM
where to use CPLD & where to use FPGA? kulkarku@math.net VHDL 6 03-06-2006 07:27 AM
Can I use XPath or something to a remote Mac or Linux box and just query an xml file, not using web services and use encyrption? jake ASP .Net 0 07-06-2004 02:16 PM
Cannot use the profile "default" because it is in use, not. please.post@yur.re.ply Firefox 1 07-04-2004 03:41 AM



Advertisments