Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27212

VS 2010 Serialized Objects with changed structure

$
0
0
If I have two (or more) versions of an application and the structures (or classes) used in each version of an application change, yet have the same names, what is the best way to make sure that old versions of a structure (or class) can still be loaded into newer versions and used?

For example:

Version 1 Structure:

TestStructure:
Dim a as integer
Dim b as integer

Version 2 Structure:

TestStructure:
Dim a as integer
Dim b as integer
Dim c as integer

Version 3 Structure:

TestStructure:
Dim a as integer
Dim b as integer
Dim c as integer
Dim d as integer

Am I correct in saying that earlier version of the structure can be loaded into Version 3 structure?

What if I totally change Version 4 Structure to be something totally different?

E.G.

Version 4 Structure:

TestStructure:
Dim a as long
Dim b as string
Dim c as date
Dim d as integer

What would be the best process to load old versions of a structure into this new structure? Should I export the old values to a text file and then import them in, or is there another way?

Viewing all articles
Browse latest Browse all 27212


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>