Solved

Extending the datatable and serializable

Posted on 2004-04-29
7
532 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
7 Comments
 
LVL 37

Expert Comment

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

Expert Comment

by:tgannetts
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now