Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • Serialization and Deserialization in .NET

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 22
    Comment on it

    The process of converting an object into a stream data is known as serialization. In other words we can say that serialization is a process of converting your data into an object or an stream of data.

     

    Advantages and Disadvantages of Serialization

    The following are the basic advantages of serialization:

    • Facilitate the transportation of an object through a network
    • Create a clone of an object


    The Serializable Attribute
    In order for a class to be serializable, it must have the properties SerializableAttribute set except if they are avoided with the attribute NonSerializedAttribute.

        using System;
        using System.Collections.Generic;
        using System.Text;
        using System.Xml.Serialization;
        namespace DemoSerialization
        {
            [Serializable]
            public class Employee
            {
                public int empCode;
                public string empName;
                [XmlAttribute(empName)]
                public string EmpName
                {
                    get
                    {
                        return empName;
                    }
    
                    set
                    {
                        empName = value;
                    }
                }
            }
        }
    


    Types of Serialization

     

     

    • Binary Serialization
    • SOAP Serialization
    • XML Serialization
    .net

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: