简体   繁体   English

如何序列化.NET远程处理(.NET Framework 3.5 SP1)的数据集?

[英]How to serialize dataset for .NET remoting (.NET Framework 3.5 SP1)?

I use the binaryFormatter to serialize objects for sending. 我使用binaryFormatter来序列化要发送的对象。 But as for the ADO.NET dataset, what is the best practice? 但是对于ADO.NET数据集,最佳实践是什么? I noticed that binary formatter is override by xmlformatter in case of dataset? 我注意到如果使用数据集,二进制格式化程序会被xmlformatter覆盖吗? how to reduce the size & increase the serialization speed? 如何减小大小并提高序列化速度?

You can tell it to use binary-mode instead of the legacy xml mode: 您可以告诉它使用二进制模式而不是传统的xml模式:

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. 您也可以尝试通过GZipStreamDeflateStream运行序列化DeflateStream ,但这可能需要将其作为BLOB发送,而不是直接进行远程处理。

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. 我还做了一些最近的工作,希望通过protobuf-net推送DataTable ,包括比较指标 -即使您不希望对protobuf进行调整,数字数据也应该可以帮助您在xml / binary和vanilla /之间进行选择gzip /放气。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM