Sunday, March 11, 2012

Yet another issue with DataColumn inhertiance

On Tue, 12 Sep 2006 19:49:39 -0400, "Joe" <jbassking@.noemail.noemail> wrote:
>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
Yes, it has to attribute.
"Otis Mukinfus" <phony@.emailaddress.com> wrote in message
news:j0keg2d6mi4nh4p8283qshot8a3aq1s74l@.4ax.com...
> On Tue, 12 Sep 2006 19:49:39 -0400, "Joe" <jbassking@.noemail.noemail>
> wrote:
>>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
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" <jbassking@.noemail.noemail> wrote in message
news:uTp28%23u1GHA.3464@.TK2MSFTNGP03.phx.gbl...
> Yes, it has to attribute.
> "Otis Mukinfus" <phony@.emailaddress.com> wrote in message
> news:j0keg2d6mi4nh4p8283qshot8a3aq1s74l@.4ax.com...
>> On Tue, 12 Sep 2006 19:49:39 -0400, "Joe" <jbassking@.noemail.noemail>
>> wrote:
>>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
>
Hi Miha,
Could you possibly give me an example of using the custom serialization
attributes?
-Joe
"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:eeew1Pw1GHA.4484@.TK2MSFTNGP02.phx.gbl...
> 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" <jbassking@.noemail.noemail> wrote in message
> news:uTp28%23u1GHA.3464@.TK2MSFTNGP03.phx.gbl...
>> Yes, it has to attribute.
>> "Otis Mukinfus" <phony@.emailaddress.com> wrote in message
>> news:j0keg2d6mi4nh4p8283qshot8a3aq1s74l@.4ax.com...
>> On Tue, 12 Sep 2006 19:49:39 -0400, "Joe" <jbassking@.noemail.noemail>
>> wrote:
>>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
>>
>
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.)
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.)

No comments:

Post a Comment