Connecting Tech Pros Worldwide Forums | Help | Site Map

Is a binary-serialized DataSet versioning tolerant?

=?Utf-8?B?TWFydGluIEtvY2g=?=
Guest
 
Posts: n/a
#1: Jun 27 '08
1st I serialize a DataSet (contains 14 DataTables) into file, with
BinaryFormatter.
2nd I change some columns in a DataTable.
3rd When I now Deserialize the DataSet from bin file got I problems ??

Thanks in advance


Ignacio Machin ( .NET/ C# MVP )
Guest
 
Posts: n/a
#2: Jun 27 '08

re: Is a binary-serialized DataSet versioning tolerant?


On Apr 17, 7:41*am, Martin Koch <martin.k...@swisslife.ch.wrote:
Quote:
1st * *I serialize a DataSet (contains 14 DataTables) into file, with
BinaryFormatter.
2nd * I change some columns in a DataTable.
3rd * *When I now Deserialize the DataSet from bin file got I problems??
>
Thanks in advance
Yu will get the same dataset that when you serialized it the first
time.

Ignacio Machin ( .NET/ C# MVP )
Guest
 
Posts: n/a
#3: Jun 27 '08

re: Is a binary-serialized DataSet versioning tolerant?


On Apr 17, 7:41*am, Martin Koch <martin.k...@swisslife.ch.wrote:
Quote:
1st * *I serialize a DataSet (contains 14 DataTables) into file, with
BinaryFormatter.
2nd * I change some columns in a DataTable.
3rd * *When I now Deserialize the DataSet from bin file got I problems??
>
Thanks in advance
Just to add, you will get the same result using any other
serialization method.

Remember, you will get a NEW instance of a Dataset (which contains all
the dattables) . It has no knowledge that the "original" instance
changed.
=?Utf-8?B?TWFydGluIEtvY2g=?=
Guest
 
Posts: n/a
#4: Jun 27 '08

re: Is a binary-serialized DataSet versioning tolerant?




"Ignacio Machin ( .NET/ C# MVP )" wrote:
Quote:
Yu will get the same dataset that when you serialized it the first
time.
Thanks for the answer!

I have done the following:
....
BinaryFormatter f = new BinaryFormatter();

using ( FileStream fs = new FileStream( @"MyFile.bin", FileMode.Open ) )
{
dsDes = (DataSet1)f.Deserialize( fs );
}

The cast (DataSet1) works although I have deleted a column in a DataTable
in the DataSet1 before I called the Deserialize() function.


Closed Thread