Solved

Extending the datatable and serializable

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

707 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