.NET Citizenship for DataTable

Published 15 April 04 04:01 PM | despos

Cleve pointed out:

I hear tell that in ADO.NET 2.0 the DataTable is now a first class citizen and supports serialization along with other DataSet features.

Correct. In 2.0, the DataTable implements the IXmlSerializable interface and provides the ReadXml/WriteXml methods that could only be emulated in 1.x.

Serializing a DataTable to and from Web service methods is possible now. Now? In 2.0, I mean. In addition, I've seen (but not tested yet) a RemotingFormat property that when set to a nonzero value serializes the DataTable object in a binary (that is, non XML) format. I'm not sure what "binary format" exactly means. Anakrino fails showing the code of the key method and I'm unable to have .NET Reflector even work on 2.0 assemblies. However, binary format is something that explicitly replaces the pure XML serialization format (remains the default) in use so far.

Comments

# Scott Galloway said on April 15, 2004 11:27 AM:

THe Binary format is incredibly good - it was always an issue that if you wanted to send a DataTable over (for example) a web service, it always serialized in XML - even if you used the BinaryFormatter this made it HUGE in byte terms. I've used various work-arounds including the CompactFormatter (http://www.freewebs.com/compactFormatter/) stuff to get DataTables and DataSets to serialize in a nice compact way - doing this and applying compression can save you 95% compared to bog standard XML Serialization. Anyway, good news. now we just need to get the Web Service Proxy class to support compression (which MS seem to be unaware of the existence of the most of the .NET languages - though J# supports it!)

# TrackBack said on April 16, 2004 02:35 PM:

Take Outs for 15/16 April 2004

Leave a Comment

(required) 
(required) 
(optional)
(required)