Все вопросы: [binary-serialization]
5 вопросов
Test for Optional Field when using .NET Custom Serialization
Given a class like this one: [Serializable] public class MyClass { string name; string address; public MyClass(SerializationInfo info, StreamingContext context){ name = info.GetString("name"); if(/* todo: check if a value for address exists */) address = ...
Convert a byte[] array into DataTable
I saved an object of type DataTable into SQL 2005 database in a field of type varbinary. I want to retrieve it back but I wasn't able to type cast it. This is how i saved it. MemoryStream memStream = new MemoryStream(); StreamWriter sw = new StreamWriter(memStream); sw.Write(dt); con.Open()...
How do I deserialize old data for a type that has changed?
I have data that has been stored using binary serialization for the following class: [Serializable] public abstract class BaseBusinessObject { private NameValueCollection _fieldErrors = new NameValueCollection(); protected virtual NameValueCollection FieldErrors { get { retu...
What are the differences between the XmlSerializer and BinaryFormatter
I spent a good portion of time last week working on serialization. During that time I found many examples utilizing either the BinaryFormatter or XmlSerializer. Unfortunately, what I did not find were any examples comprehensively detailing the differences between the two. The genesis of my curio...
десериализация универсального списка возвращает ноль
Я де / сериализую объект следующим образом: public class myClass : ISerializable { public List<OType> value; public myClass(SerializationInfo info, StreamingContext context) { this.value = (List<OType>)info.GetValue("value", typeof(List<OType>)); } void ISeri...