Save a class instance to a datatable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • VBWheaties
    New Member
    • Feb 2008
    • 145

    Save a class instance to a datatable

    I think this is possible, but correct me if not.

    Vb.Net, I have a serializable class meaning instances of the class can be persisted to disk or memory.

    I want to use a DataTable to store these instances. For example, having a column called ClassInstance which will hold the serialized instance of the class.

    My question is, what datatype to use for the column definition and what method to use to load the serialized instance into the datatable row.

    Thanks for any help on this.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    To be on the safe side, I would go with a binary or whatever stores the data as bytes (hehe 'this bytes.com' ). Although as I understand it, serializable saves as a "string", so any sufficiantly large enough string column should work?

    Comment

    • shweta123
      Recognized Expert Contributor
      • Nov 2006
      • 692

      #3
      Hi ,

      Please refer this Link

      Originally posted by VBWheaties
      I think this is possible, but correct me if not.

      Vb.Net, I have a serializable class meaning instances of the class can be persisted to disk or memory.

      I want to use a DataTable to store these instances. For example, having a column called ClassInstance which will hold the serialized instance of the class.

      My question is, what datatype to use for the column definition and what method to use to load the serialized instance into the datatable row.

      Thanks for any help on this.

      Comment

      Working...