I want to store the objects that i create in run time in database. In a way
that, for a product a create an object from a class written with C#, define
its properties and functions that it has, and want to store it in a database
(SQL Server 2K). I want the columns to be created and filled dynamically when
an object is inserted in db (Just like in J2EE, which is called i think
relational mapping, or something like this).

How can I do that?

Re: How to store objects created with C# in database in .NET Framework by Mahesh

Mahesh
Mon Dec 19 05:43:38 CST 2005

May this helps you,
- Serialize your object at run-time using binary formatter into byte stream
- Store the binary data into sql server database as BLOB like how you store
images etc as binary data
- On extraction, get the binary data stream as byte[] and deseializer it to
get actual object

Or You may want to use the way given in the following link,
http://www.codeproject.com/cs/database/persistedobject.asp

HTH,

"basulasz" <basulasz@discussions.microsoft.com> wrote in message
news:70B8BE55-A0BA-4BAF-8283-E67B0C9B7782@microsoft.com...
> I want to store the objects that i create in run time in database. In a
way
> that, for a product a create an object from a class written with C#,
define
> its properties and functions that it has, and want to store it in a
database
> (SQL Server 2K). I want the columns to be created and filled dynamically
when
> an object is inserted in db (Just like in J2EE, which is called i think
> relational mapping, or something like this).
>
> How can I do that?