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

发布于 2024-10-02 09:47:44 字数 119 浏览 1 评论 0原文

我使用 binaryFormatter 序列化对象以进行发送。但对于 ADO.NET 数据集,最佳实践是什么?我注意到在数据集的情况下二进制格式化程序被 xmlformatter 覆盖?如何减小尺寸&提高序列化速度?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心奴独伤 2024-10-09 09:47:44

您可以告诉它使用二进制模式而不是旧的 xml 模式:

myData.RemotingFormat = SerializationFormat.Binary;

您还可以尝试通过 GZipStream 或 DeflateStream 运行序列化程序,但这可能需要将其发送为BLOB 而不是直接远程处理。

我最近还做了一些关于通过 protobuf-net 推送 DataTable 的工作,此处,包括比较指标 - 即使您不需要 protobuf 调整,数字数据也应该可以帮助您在 xml/binary 和 vanilla/gzip/ 之间进行选择放气。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文