473,796 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question on binary serialization of datasets

Hello,

I have an object which has various properties, including one which is
of type DataSet.

I need to serialize this object in binary format, but I've discovered
that the BinaryFormatter will only format datasets in XML format.

I've read various articles on how to address the problem, including
the KB829740 article which talks about using a DataSetSurrogat e
class.

I'm not quite sure how this class would work in my
circumstance, because the sample it gives deals with the simple
case of just serializing a dataset, rather than serializing an
object that has a dataset.

Should I have a new property of type DataSetSurrogat e in my object
and pass the DataSet object in my class to this DataSetSurrogat e's
constructor? If so, how do I stop the existing DataSet from being
serialized?

Presumably, when I deserialise my object, I should use the
ConvertToDataSe t method of the DataSetSurrogat e property that
I get back to produce the original DataSet, right?

I would appreciate any answers/clarification I get on this subject.

--
Akin

aknak at aksoto dot idps dot co dot uk
Nov 20 '05 #1
2 2167
this should help.

http://www.eggheadcafe.com/articles/20031219.asp

Cheers,

Greg

"Wild Wind" <no****@blackho le.com> wrote in message
news:2k******** *****@uni-berlin.de...
Hello,

I have an object which has various properties, including one which is
of type DataSet.

I need to serialize this object in binary format, but I've discovered
that the BinaryFormatter will only format datasets in XML format.

I've read various articles on how to address the problem, including
the KB829740 article which talks about using a DataSetSurrogat e
class.

I'm not quite sure how this class would work in my
circumstance, because the sample it gives deals with the simple
case of just serializing a dataset, rather than serializing an
object that has a dataset.

Should I have a new property of type DataSetSurrogat e in my object
and pass the DataSet object in my class to this DataSetSurrogat e's
constructor? If so, how do I stop the existing DataSet from being
serialized?

Presumably, when I deserialise my object, I should use the
ConvertToDataSe t method of the DataSetSurrogat e property that
I get back to produce the original DataSet, right?

I would appreciate any answers/clarification I get on this subject.

--
Akin

aknak at aksoto dot idps dot co dot uk

Nov 20 '05 #2
Hello Greg,

I've read that article, but while it talks about a new class called
CompactFormatte r, it doesn't answer the very specific questions
I've asked about the use of the *DataSetSurroga te* class which is
what I am thinking of using. The questions (again) are:

To use the DataSetSurrogat e for a DataSet that is a property of an
object, should I have a new property of type DataSetSurrogat e in my object
and pass the DataSet object in my class to this DataSetSurrogat e's
constructor? If so, how do I stop the existing DataSet from being
serialized?

Presumably, when I deserialise my object, I should use the
ConvertToDataSe t method of the DataSetSurrogat e property that
I get back to produce the original DataSet, right?

TIA,

Akin

"Greg Young" <gr********@pla netbeach.com> wrote in message
news:e0******** ******@TK2MSFTN GP11.phx.gbl...
this should help.

http://www.eggheadcafe.com/articles/20031219.asp

Cheers,

Greg

"Wild Wind" <no****@blackho le.com> wrote in message
news:2k******** *****@uni-berlin.de...
Hello,

I have an object which has various properties, including one which is
of type DataSet.

I need to serialize this object in binary format, but I've discovered
that the BinaryFormatter will only format datasets in XML format.

I've read various articles on how to address the problem, including
the KB829740 article which talks about using a DataSetSurrogat e
class.

I'm not quite sure how this class would work in my
circumstance, because the sample it gives deals with the simple
case of just serializing a dataset, rather than serializing an
object that has a dataset.

Should I have a new property of type DataSetSurrogat e in my object
and pass the DataSet object in my class to this DataSetSurrogat e's
constructor? If so, how do I stop the existing DataSet from being
serialized?

Presumably, when I deserialise my object, I should use the
ConvertToDataSe t method of the DataSetSurrogat e property that
I get back to produce the original DataSet, right?

I would appreciate any answers/clarification I get on this subject.

--
Akin

aknak at aksoto dot idps dot co dot uk


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
6520
by: Ching-Lung | last post by:
Hi all, I try to create a tool to check the delta (diff) of 2 binaries and create the delta binary. I use binary formatter (serialization) to create the delta binary. It works fine but the delta binary is pretty huge in size. I have 1 byte file and 2 bytes file, the delta should be 1 byte but somehow it turns out to be 249 bytes using binary formatter. I guess serialization has some other things added to the delta file.
2
6653
by: Dave Veeneman | last post by:
I'm working on a project where I have to persist data to a file, rather than to a database. Basically, I need to save the state of several classes, each of which will have a couple of dozen instances. I have set it up to use binary serialization to a single file, which works well. However, I have learned that changes to my classes break the old serialized files. While my object model is pretty stable, I am concerned that using binary...
11
11962
by: ajou_king | last post by:
I was running some tests on my Win32 1GHZ processor to see how long it would take to transmit objects numerous times via TCP/IP using C# ..NET Remoting vs the C++ trustworthy method of binary streams. I ran the test for 50K, 100K, 500K iterations, where each iteration consists of sending an object from a client process to a server process, and the server process sends back an ack. Here are the results: .NET Remoting C++...
14
2430
by: Tiraman :-\) | last post by:
Hi, i have a StreamWriter that hold a System.Net.Sockets.NetwrokStream and the StreamWriter Object Hold An ArrayList which i would like to Serialize And Send it back to the client via the StreamWriter.Flush() Dim writer As New IO.StreamWriter(System.Net.Sockets.TcpClient.GetStream) writer.Write(myArray)
3
2664
by: Marc Gravell | last post by:
Kind of an open question on best-practice for smart-client design. I'd really appreciate anyones views (preferably with reasoning, but I'll take what I get...). Or if anybody has any useful links on the subject? (and yes, I have already googled it at length, but still no strong decision) ============= After a long stint of pure-desktop / pure-server applications, I'm currently working on a number of smart-client projects in C# using...
11
1457
by: jason | last post by:
we have developed a .NET class library that defines a family of reusable business objects. the class library is developed in C#, and works quite well. one problem, however, is that as more and more applications are being developed to consume this class library, we are running into deployment and version controll issues. i recall a lot of this kind of thing being solved with distributed application models, such as the EJB...
1
2209
by: Paez | last post by:
Hi There. This post is a extension of thread "Serialize or not to Serialize", on 5 of December of 2006. The reason why my teacher insists that a WS cannot return a Dataset is due to low rate networks, not due to SOAP schemas. I think that's because a XML Dataset is too large. So, in my WS, I want to turn my dataset in some type of class, and then send
8
1403
by: Casper | last post by:
Hi, i read several articles about serialization. I know now that it is a process of converting an object into a stream of data so that it can be is easily transmittable over the network or can be continued in a persistent storage location. Now i did some tests in order to understand it better: I first executed the code below (this (summarized) code produces a virtual simple shopping cart which is put in the Profile of the user) with...
1
11109
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
0
9524
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10168
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9047
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5568
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.