1

I use the binaryFormatter to serialize objects for sending. But as for the ADO.NET dataset, what is the best practice? I noticed that binary formatter is override by xmlformatter in case of dataset? how to reduce the size & increase the serialization speed?

1 Answer 1

1

You can tell it to use binary-mode instead of the legacy xml mode:

myData.RemotingFormat = SerializationFormat.Binary; 

You can also try running the serializer through GZipStream or DeflateStream, but this would probably require sending it as a BLOB rather than direct remoting.

I've also done some recent work looking at pushing DataTable through protobuf-net, here, including comparison metrics - even if you don't want the protobuf-tweaks, the data of numbers should help you choose between xml/binary and vanilla/gzip/deflate.

Sign up to request clarification or add additional context in comments.

5 Comments

Kinda off topic, but do you know of a way to prevent the Schema being transferred on an untyped dataset?
@leppie - at a guess: data.SchemaSerializationMode = SchemaSerializationMode.ExcludeSchema;
Unfortunately that requires a typed dataset :( Which I cant use in my case (MS Sync framework 1.0).
@leppie how are you doing the serialize? You can include it as a parameter if it is you calling it - XmlWriteMode.IgnoreSchema etc.
Unfortunately, the Sync framework (well at least the version I am stuck with) hides all those details.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.