Results 1 to 7 of 7

Thread: Serialization pros and cons

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    Question Serialization pros and cons

    first time ever I did some examples of Serialization.

    I am on the hook to write code that would read an excel file that has five fields.

    Should I use the conventional way to read and write the data from the excel file or Seriable way ?

    are there any disadv and advantages on way over the other?

    thanks
    nath

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Serialization pros and cons

    What sort of Excel file is it? If its a CSV ten you don't need serialization. If its a normal excel file then serialization won't work unless you do it all manually.
    I don't live here any more.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    Re: Serialization pros and cons

    what is the advantage of using Serializable way?

    the file is comma separated values file.

    thanks
    nath

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Serialization pros and cons

    If you're reading a CSV file then you'd simply use a StreamReader or ADO.NET. I don't see an advantage to doing it any other way, although that doesn't mean that there isn't one.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    Re: Serialization pros and cons

    Jm,

    the reason for my thought of using serialization is, after reading the content of the excel file (which has historical data of a stock), I would like to show that data in a chart (just like they show in yahoo finance).

    does this requirement need the data to be read from CSV file in serialization format?

    thanks
    nath

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Serialization pros and cons

    The point of serialisation is to convert an object into a form that can easily be sent over a serial connection, hence the name. If you want to create a chart then I don't see how that helps you. What you would want for a chart would be tabular data, so I would think that using ADO.NET to read the CSV into a DataTable would be the most effective in that case. If you prefer there would be less overhead (I think) using a StreamReader and you could still read the data into a DataTable or some other form, like a jagged or multidimensional array or some form of collection. I guess the advantage of ADO.NET is that more is done for you and you have the power of SQL to perform complex queries on the data if desired.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: Serialization pros and cons

    I have written a stupid ExcelReader class and ExcelRow. You might want to look at it. Also attached is a unit test of my ExcelReader class.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width