473,834 Members | 1,900 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 2169
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
6526
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
6657
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
11967
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
2433
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
2665
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
1460
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
2210
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
1404
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
11113
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
0
9799
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9646
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
10512
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
10550
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,...
1
7760
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5796
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3083
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.