PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Yet another issue with DataColumn inhertiance
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Yet another issue with DataColumn inhertiance
![]() |
Yet another issue with DataColumn inhertiance |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#4 |
|
Guest
Posts: n/a
|
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 > > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
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 >> >> > > |
|
|
|
#6 |
|
Guest
Posts: n/a
|
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.) |
|
|
|
#7 |
|
Guest
Posts: n/a
|
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.) |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

