Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have 2 entities (student, course) that I want to serialize & deserialize without using Generic & Reflection.

This would be in a project three layers and using .NET 1.0.

Any ideas?

I do Serialization/Deserialization methods in both class but there is a error in deserialize error:cannot convert expression type int to return type MyApp_Common.Student

Quote:
So... manually implement Serialization/Deserialization methods in both class


Quote:
no its not school homework



Quote:
ok I know ,I do with .netframework4 and reflection but I want do that with .netframework1 and with out use reflection and Generic



C#
private string SerializeStudent(Student student)
    {
        return student.Id.ToString() + ',' + student.FirstName + ',' + student.LastName;
    }

    private Student DeserializeStudent(string[] str)
    {
        Student student = new Student();

        return student.Id = 5;

    }
Posted
Updated 25-Dec-13 1:11am
v3
Comments
Sergey Alexandrovich Kryukov 25-Dec-13 17:08pm    
Yes, I have an idea. Don't do it without Reflection, ever. Learn Serialization. Better move to .NET 3.5 or later, to be able to use available Data Contract for serialization. And, if you can, try to get away from C# v.1. "Real" .NET started with v.2.0 and C# v.2; everything before that should better be forgotten.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900