I want to serialize an object in VB.Net and store the data in SQL Server 2000, and be able to retrieve and deserialize it later. Can anyone explain how I can do that Specifically, how do I insert a stream into a database field What data type should the field be Image This seems like it should be possible, but I'm having trouble finding info on how to do it. Any help would be appreciated. Thanks!

Serialization to DB
Saranya
For example, DataSet is serializable, a DataSet object with some user data in it can be serialized, stored, then later create another DataSet object with the same structure and user data.
Many .NET native classes are serializable. To serialize a custom class, that class has to be defined as [Serializable] in C#/<Serializable> in VB, this is simple attribute may be enough for simple classes, more complex classes may require explicitely implementation of the ISerializable interface, which has a constrctor for deserialization and a GetObjectData method for serialization.
The IXmlSerializable interface, XmlSerializer class are for xml serialization.
Serialization is useful primarily for transmitting data from one place to another, use it for data persistance may not be a good idea, at lease from performance, and code complexity consideration. When there is a database, better try to store each data item in a table column, a data record can be considered as an object state, and the table definition as the class structure.
Phil333
To deserialze, you would load from "New MemoryStream(Convert.FromBase64String(TextFromDatabase))"
Duppi
To do this the object needs to be "serialized".. How do I determine if it is
I am trying to store MicroStation Element objects to database, but it seems they are not able to be serialized.. Does that mean that I can't store them in a database
Havard
Paulo Sebastiao
DB table can store binary, save the base64 conversion, fater this way, and save more space, because base64 takes 1/3 more space, it turns 3 bytes into 4 bytes.
Base64 is necessary if the data is used in XML or HTML, ASP.NET __VIEWSTATE is base64 string.