Hello Max,
I assume that you meant the size of the dataset's serialization result by
"the size of a dataset (including data in the data tables and rows). The
answer depends on the serialization format:
If we use BinaryFormatter, Code list 1 shows the pseudocode:
---Code list 1 ---
DataSet ds = GetData();
ds.RemotingFormat = SerializationFormat.Binary;
BinaryFormatter bin = new BinaryFormatter();
bin.Serialize(stream, ds);
Console.Write(stream.Length);
If we serialize the dataset to XML, we can do it in this way:
---Code list 2 ---
DataSet ds = GetData();
Console.Write(Encoding.UTF8.GetByteCount(ds.GetXml()));
For more information of DataSet Serialization, please refer to the
articles:
Binary Serialization of DataSets
http://msdn.microsoft.com/en-us/magazine/cc163911.aspx
Improving DataSet Serialization and Remoting Performance
http://support.microsoft.com/kb/829740/en-us
If you have any other questions or concerns, please DON'T hesitate to tell
me.
Regards,
Jialiang Ge (
[email protected], remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.