I’ve got a ‘MyDataTable’ class that inherits from System.Data.DataTable
I’ve implemented ISerializable in my class and have a ‘Public Overrides Sub GetObjectData…’
But when I try to serialize the an object of ‘MyDataTable’ I get an error saying that ‘MyDataTable’ is not marked as serializable.
If I used a DataTable instead – my code serializes correctly.
If I add a serializable attribute to the ‘MyDataTable’ class – it serializes correctly, but I’m told that is unnecessary if I implement ISerializable.
Can someone point me in the right direction?
Whoever told you it is unnecessary to add the SerializableAttribute is incorrect:
And from the ISerializable entry (em added):