BUG: Binary Serilization on DataSet and Windows XP in .NET Remoti

G

Guest

If you do .NET Remoting and Binary Serilization with DataSet it does not work.

If you set the Serialization type to Binary on DataSet, it does not seralize
it correctly on windows xp. To do this set the serilization to Binary and use
it in remoting on Windows XP.

Is there a way around this?
 
G

Guest

In .NET 1.1 , DataSet only knows how to describe itself to the serialization
framework in textual XML. If this is the platform, you can use something like
Ravinder Vuppula's (Microsoft) DataSetSurrogate class, which nicely flattens
out a DataSet into mostly serializable ArrayLists, and will also reconstruct
one back to the original DataSet.
In .NET 2.0, the DataSet has a Binary SerializationFormat property , e.g.:

ds.RemotingFormat = SerializationFormat.Binary

Hope that helps.
Peter
 
G

Guest

P.S.
I have never seen this so called "bug" that you describe with Windows XP. Do
you want to post a "short but complete" (a -la Jon Skeet) code sample?
Peter
 
C

Cor Ligthert [MVP]

Mike,

I know about deseralization problems in the standard samples from Microsoft
about the dataset.

However this code should work, be aware that I translated it from a VB.Net
sample on our website so whatch typos or whatever.

\\
//Serialize
System.IO.StringWriter sw = new System.IO.StringWriter();
ds.WriteXml(sw);
string mystring = sw.ToString();
//''''''''''''''''''''''''''''''''''''''
//Deserialize
System.IO.StringReader sr = new System.IO.StringReader(mystring);
DataSet ds2 = new DataSet();
ds2.ReadXml(sr) ;
//

I hope this helps,

Cor
 
G

Guest

Hello,

Set the DataSet Serialization format to Binary and use and fill some fields
and then send them to the .NET remoting server in which the server uses SQL
Server which uses DataTime type in its table. This must be done using
remoting and on windows xp. I am not sure that this may create the bug, but
I get SqlDateTime overflow, but when I use it in normal way without remoting
or with remoting on windows 2003 I do not get any error message because I set
the date to DateTime.Now.
 
G

Guest

Hello,

Set the DataSet Serialization format to Binary and use and fill some fields
and then send them to the .NET remoting server in which the server uses SQL
Server which uses DataTime type in its table. This must be done using
remoting and on windows xp. I am not sure that this may create the bug, but
I get SqlDateTime overflow, but when I use it in normal way without remoting
or with remoting on windows 2003 I do not get any error message because I set
the date to DateTime.Now.
 
J

Jon Skeet [C# MVP]

Mike9900 said:
Set the DataSet Serialization format to Binary and use and fill some fields
and then send them to the .NET remoting server in which the server uses SQL
Server which uses DataTime type in its table. This must be done using
remoting and on windows xp. I am not sure that this may create the bug, but
I get SqlDateTime overflow, but when I use it in normal way without remoting
or with remoting on windows 2003 I do not get any error message because I set
the date to DateTime.Now.

That's not the kind of demonstration Peter was suggesting.

See http://www.pobox.com/~skeet/csharp/complete.html
 

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