By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,132 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,132 IT Pros & Developers. It's quick & easy.

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

P: n/a
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?
--
Mike
Sep 26 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Mike9900" wrote:
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?
--
Mike
Sep 27 '06 #2

P: n/a
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Mike9900" wrote:
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?
--
Mike
Sep 27 '06 #3

P: n/a
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
"Mike9900" <Mi******@discussions.microsoft.comschreef in bericht
news:F0**********************************@microsof t.com...
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?
--
Mike

Sep 27 '06 #4

P: n/a
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.

--
Mike
"Peter Bromberg [C# MVP]" wrote:
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Mike9900" wrote:
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?
--
Mike
Sep 27 '06 #5

P: n/a
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.

--
Mike
"Cor Ligthert [MVP]" wrote:
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
"Mike9900" <Mi******@discussions.microsoft.comschreef in bericht
news:F0**********************************@microsof t.com...
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?
--
Mike


Sep 27 '06 #6

P: n/a
Mike9900 <Mi******@discussions.microsoft.comwrote:
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

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Sep 27 '06 #7

P: n/a
Jon,
If we would all read that Bertrand Russell quote once each morning, I
suspect the world should become a better place!
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jon Skeet [C# MVP]" wrote:
Mike9900 <Mi******@discussions.microsoft.comwrote:
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

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Sep 27 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.