Solved

Extending the datatable and serializable

Posted on 2004-04-29
7
557 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 125 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 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