PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Yet another issue with DataColumn inhertiance

Reply

Yet another issue with DataColumn inhertiance

 
Thread Tools Rate Thread
Old 13-09-2006, 12:49 AM   #1
Joe
Guest
 
Posts: n/a
Default Yet another issue with DataColumn inhertiance


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


  Reply With Quote
Old 13-09-2006, 01:26 AM   #2
Otis Mukinfus
Guest
 
Posts: n/a
Default Re: 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
  Reply With Quote
Old 13-09-2006, 05:47 AM   #3
Joe
Guest
 
Posts: n/a
Default Re: Yet another issue with DataColumn inhertiance

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



  Reply With Quote
Old 13-09-2006, 08:12 AM   #4
Miha Markic [MVP C#]
Guest
 
Posts: n/a
Default Re: Yet another issue with DataColumn inhertiance

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

>
>



  Reply With Quote
Old 13-09-2006, 04:23 PM   #5
Joe
Guest
 
Posts: n/a
Default Re: Yet another issue with DataColumn inhertiance

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

>>
>>

>
>



  Reply With Quote
Old 14-09-2006, 10:34 AM   #6
Kevin Yu [MSFT]
Guest
 
Posts: n/a
Default Re: Yet another issue with DataColumn inhertiance

Hi Joe,

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

http://msdn2.microsoft.com/en-us/li...lization.iseria
lizable.aspx

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

http://msdn2.microsoft.com/en-us/li...eattribute.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/subscript...ault.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/subscript...rt/default.aspx.
==================================================

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

  Reply With Quote
Old 18-09-2006, 11:14 AM   #7
Kevin Yu [MSFT]
Guest
 
Posts: n/a
Default Re: Yet another issue with DataColumn inhertiance

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

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off