Serializing / persistently storing & retrieving VB objects in & from SQL Server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin Widmer

    Serializing / persistently storing & retrieving VB objects in & from SQL Server

    Hi guys

    I am wondering what is a proper way to persistently store objects into
    SQL-Server. I see four possible ways:

    1.) Serialize to XML and then store the XML in the SQL server
    2.) Write a new serializer that serializes the object by storing each
    attribute value into a matching field in an SQL server table while
    performing data type mapping and possibly compression etc...
    3.) For each class write a proxy class who's objects are internally linked
    directly and online to the matching tables in the SQL server
    4.) Buy a proprietary serializing component from a 3rd party firm that does
    all the job

    Of course 4 will do but I want to learn how to do it myself. Any hints or
    best practise advice?

    Martin


  • Ken Tucker [MVP]

    #2
    Re: Serializing / persistently storing & retrieving VB objects in & from SQL Server

    Hi,

    SQL Server 2005 has User defined types.

    You can access UDT functionality in SQL Server from the Transact-SQL language using regular query syntax. Define UDT tables and columns and manipulate UDT data.


    Ken
    ---------------
    "Martin Widmer" <martin.widmer@ businessnet.de> wrote in message
    news:dpinhg$je4 $1@nntp.init7.n et...[color=blue]
    > Hi guys
    >
    > I am wondering what is a proper way to persistently store objects into
    > SQL-Server. I see four possible ways:
    >
    > 1.) Serialize to XML and then store the XML in the SQL server
    > 2.) Write a new serializer that serializes the object by storing each
    > attribute value into a matching field in an SQL server table while
    > performing data type mapping and possibly compression etc...
    > 3.) For each class write a proxy class who's objects are internally linked
    > directly and online to the matching tables in the SQL server
    > 4.) Buy a proprietary serializing component from a 3rd party firm that
    > does all the job
    >
    > Of course 4 will do but I want to learn how to do it myself. Any hints or
    > best practise advice?
    >
    > Martin
    >[/color]


    Comment

    Working...