J
John
Hi,
I need to serialize one of my objects to the database as a
string, i.e the database field is a varchar. I can't see
a way of doing without doing the following:
MemoryStream ms = new MemoryStream();
IFormatter Iformatter = new BinaryFormatter();
Iformatter.Serialize(ms,myObject);
byte[] bMyObject = ms.GetBuffer();
foreach(byte oByteChar in bFilterConditions)
{
strObjectToSave += Convert.ToChar(oByteChar);
}
drMyObject.VALUE = strObjectToSave;
Is there a better way of doing this?, I need to do the
above when I'm deserializing the object as well.
Any help much appreciated.
John
I need to serialize one of my objects to the database as a
string, i.e the database field is a varchar. I can't see
a way of doing without doing the following:
MemoryStream ms = new MemoryStream();
IFormatter Iformatter = new BinaryFormatter();
Iformatter.Serialize(ms,myObject);
byte[] bMyObject = ms.GetBuffer();
foreach(byte oByteChar in bFilterConditions)
{
strObjectToSave += Convert.ToChar(oByteChar);
}
drMyObject.VALUE = strObjectToSave;
Is there a better way of doing this?, I need to do the
above when I'm deserializing the object as well.
Any help much appreciated.
John