Monday, March 12, 2012

Save Class

Hello,

I created a class in my .Net code and I have an SQL 2005 table with a column of type image (I suppose I should use this type)

After I define the class properties I need create a new record and save the class in the database.

Can I do it the same way as I would save, for example, a string in a varchar field?

Thanks,

Miguel

Hi shapper,

Are you trying to put an object into database? There are many ways.

1. You can serialize the object to Xml or binary, and save the serialized result to a string or binary field.

2. You can define a database table. Each column of the table correspond to a field of the class object. You can create some INSERT/UPDATE/DELETE/SELECT command to do all the operations on the records.

No comments:

Post a Comment