Hello,
Consider I have a String:
Dim MyStringAs String ="Hello"or an Integer:
Dim MyIntegerAs Integer = 100or a class which its properties:
Dim MyClass As New MyCustomClassMyClass.Property1 ="Hello"MyClass.Property2 = Unit.Pixel(100)MyClass.Property3 = 100Or even a control:
Dim MyLabelAs LabelMyLabel.Id ="MyLabel"MyLabel.CssClass ="MyLabelCssClass"
Is there a way to save a String, an Integer, a Boolean, a Class, a Control in an SQL database?
Something like:
Define something (Integer, String, Class, Control, etc)
Save in SQL 2005 Database
Later in code Retrive from database given its ID
Is this possible?
How should I do this?
What type of SQL 2005 table field should be used to store the information?
Thanks,
Miguel
Yes it is possible
You can serialize your object (some extra design work) and save as XML in XML field. The advantage is that you can search this XML on SQL server. Another solution is to save your object as binary data in image field or varbinary(max) (which is now recommended replacement for image field). You probably have to have another field in your database to identity your object.
Thanks
No comments:
Post a Comment