?
Solved

Extending the datatable and serializable

Posted on 2004-04-29
7
Medium Priority
?
567 Views
Last Modified: 2008-03-10
I have created a GeneralDataTable that has some additial properties.  How do I set it up so it serializes when remoting.

 When I first did it I got An error saying it was not serializable.  I add that attribute but now I get A message saying The constructor to deserialize an object of type IpscoCommon.Common.GeneralDataTable was not found.
What do I do to get this error resolved.

0
Comment
Question by:d_potts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 10955075
it has to have a constructor that takes no parameters.
0
 
LVL 5

Expert Comment

by:tgannetts
ID: 10957827
In addition to the default constructor as suggested by GregoryYoung, I think you need to add the following constructor as well:

Imports System.Runtime.Globalization

...

Public Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)

     MyBase.New(info, context)

End Sub

Tom.
0
 
LVL 2

Author Comment

by:d_potts
ID: 10959263
That worked but in my form code I dim the GeneralDataTable.  Then I call my middle tier that returns me a generateDataTable with data.  Then when I check the propties of my GeneralDataTable on my form in contains all the data but any custom propties that I set in the middle layer have been set to nothing.  Why is this?

0
 
LVL 2

Expert Comment

by:tobyphase
ID: 11044193
When you say your custom properties - are these all general VB.NET types or are they custom classes. If they are custom classes have you marked all of these as serializable as well? Also private properties will not be serialized if you are using XML Serialization. If you want private properties to be serialized you need to use Binary Serialization
0
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
ID: 11044232
check here ... I just went through all this on another question. http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB.NET/Q_20973647.html
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question