Standalone DataRow isn't Serializable

Published 14 August 03 03:43 PM | madsn

If you look up the DataRow class in the .NET Framework documentation you'll see this:

[Serializable]
public class DataRow

In the happy beleif that this was entirely true I designed my remoting interfaces with DataRow as parameter and return values to transport DataRow objects standalone. But no. I got a SerializationException and Malcolm Stewart with MS Developer support explains why in the adonet newsgroup:

The DataRow has no default constructor and no custom serializable method - either of which
would be required for what you want. In order for a DataRow to be
serialized, it must belong to a DataTable in a DataSet - the DataSet is
currently the smallest unit of data that can be serialized. We are aware of
this limitation and it is due to change in future versions of the product.

Please change this!

Comments

# Frans Bouma said on August 14, 2003 10:16 AM:

afaik, a datatable can also be serialized.

# Mads said on August 14, 2003 10:50 AM:

Yes, that's true. So probably the a detached DataTable with one row would be the preferred alternative? According to this article the table should be removed from the original or copied to remove the relation to the dataset.

# Jesse Ezell said on August 14, 2003 12:04 PM:

Yah, I did this too on one of my very first .NET projects (during beta 2s).... very frustrating, although you can probably get around it by implementing ISerializable and doing the serialization manually.

Leave a Comment

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

This Blog

<a name="MyWork">!My work!</a>

Funstuff

Goodies

MSCRM Blogs

Sharepoint

Useful reading

Weblogs

Syndication