?
Solved

Extending the datatable and serializable

Posted on 2004-04-29
7
Medium Priority
?
574 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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 …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

650 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