Serialized ADO.NET 1.0 dataset compatible with ADO.NET 2.0

  • Thread starter Kay-Christian Wessel
  • Start date
K

Kay-Christian Wessel

Is it possible to serialize an ADO.NET 1.0 dataset to xml and then to
deserialize it back to an ADO.NET 2.0 dataset ? And visa versa ?

Is this functionality supported for the Compact Framework also ?

Best regards
Kay-Christian Wessel
 
K

Kay-Christian Wessel

I tested this and it is not possible using the binary formatter.


Here is the exeption thrown when trying to deserialize a ADO.NET 2.0 dataset
to ADO.NET 1.0 :

An unhandled exception of type
'System.Runtime.Serialization.SerializationException' occurred in
mscorlib.dll

Additional information: Type is not resolved for member
System.Data.SerializationFormat, System.Data, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089.



I've tried to reference the System.Data.dll from the 1.1 Framework, but it
needs the system.dll from the 1.1 Framework to work, and then I loose all
the nice features of VS2005.

The reason for doing this is because Windows CE 4.2 is not working with
VS2005, and I must develop for this platform.

Could I just send the XML instead ?

And read it into a dataset on the device ?



Kay-Christian Wessel
 
K

Kay-Christian Wessel

Well, I tried the ReadXML and WriteXML methods and they worked. Only one
problem. They are very slow compared to the binary formatter.(10 times
slower)

Any other suggestions which will perform better ?


Kay-Christian Wessel
 
S

Sahil Malik [MVP C#]

Sorry I didn't reply earlier Kay, just been busy.

To make the long story short - the answer is "No" - especially if you want
both performance and interoperability between DS 1.x and DS 2.x.

What you could do however in a 1.x application, is to create your own class
that inherits from a 2.x dataset, install both frameworks on your machine,
switch over to 2.x dataset (via your subclass), when you run into a dataset
performance issue, such as remoting it etc. This can be a bit messy and
complicated, but alternatively you could simply use datasetsurrogate (search
msdn kb for "datasetsurrogate")

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
__________________________________________________________
 
K

Kay-Christian Wessel

My problem is that my 'machine' is a PDA with Compact Framework 1.0, running
CE 4.2 with no possible upgrade to Compact Framework 2.0.

This PDA is also very slow, so what performs slow on my 2,5 Ghz Pentium 4,
will almost stop working on this 400 Mhz PDA.

I guess my app will perform much better if I use some other container than
datasets when sending data ?

I'm already compacting and encrypting the datasets of course, but this does
not help so much on performance.

I'm considering passing semicolon-separated files instad.(CSV) It will
probably boost performance by some 1000 percents.

Kay
 
S

shriop

You might want to check out my csv parser that I sell for parsing those
csv files, http://www.csvreader.com . It works in CF 1.0, handles all
the nastiness of the csv, is very fast, and uses memory well.

Bruce Dunwiddie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top