Yet another issue with DataColumn inhertiance

J

Joe

Since DataColumn is not sealed I would like to inherit from it and create my
own. Unfortunately it seems that when serializing a DataTable with these
columns, only DataColumn (the base) is serialized and my derived column is
not.

Is there anyway I can use and serialize a derived DataColumn?

-Joe
 
O

Otis Mukinfus

Since DataColumn is not sealed I would like to inherit from it and create my
own. Unfortunately it seems that when serializing a DataTable with these
columns, only DataColumn (the base) is serialized and my derived column is
not.

Is there anyway I can use and serialize a derived DataColumn?

-Joe
Did you try marking your column with the Serializable attribute? It's worth a
try.
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
M

Miha Markic [MVP C#]

Hi Joe,

The good news is that it is probably possible while the bad news is that it
will be not easy at all.
DataTable uses custom serialization via ISerializable and thus you have to
override GetObjectData and create a proper constructor or use new custom
serialization via attributes (.net 2.0).
 
J

Joe

Hi Miha,

Could you possibly give me an example of using the custom serialization
attributes?

-Joe

Miha Markic said:
Hi Joe,

The good news is that it is probably possible while the bad news is that
it will be not easy at all.
DataTable uses custom serialization via ISerializable and thus you have to
override GetObjectData and create a proper constructor or use new custom
serialization via attributes (.net 2.0).

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Joe said:
Yes, it has to attribute.
 
K

Kevin Yu [MSFT]

Hi Joe,

Here is an example of how to implement the ISerializable interface.

http://msdn2.microsoft.com/en-us/library/system.runtime.serialization.iseria
lizable.aspx

And here is an example of how to use the SerializableAttribute.

http://msdn2.microsoft.com/en-us/library/system.serializableattribute.aspx

HTH.

If anything is unclear, please feel free to let us know.

Kevin Yu
Microsoft Online Community Support

==================================================
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.)
 
K

Kevin Yu [MSFT]

Hi Joe,

I'd like to know if this issue has been resolved yet. Is there anything
that I can help. I'm still monitoring on it. If you have any questions,
please feel free to post them in the community.

Kevin Yu
Microsoft Online Community Support
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top