473,394 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 DataSetSurrogate
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 DataSetSurrogate in my object
and pass the DataSet object in my class to this DataSetSurrogate's
constructor? If so, how do I stop the existing DataSet from being
serialized?

Presumably, when I deserialise my object, I should use the
ConvertToDataSet method of the DataSetSurrogate 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 2145
this should help.

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

Cheers,

Greg

"Wild Wind" <no****@blackhole.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 DataSetSurrogate
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 DataSetSurrogate in my object
and pass the DataSet object in my class to this DataSetSurrogate's
constructor? If so, how do I stop the existing DataSet from being
serialized?

Presumably, when I deserialise my object, I should use the
ConvertToDataSet method of the DataSetSurrogate 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
CompactFormatter, it doesn't answer the very specific questions
I've asked about the use of the *DataSetSurrogate* class which is
what I am thinking of using. The questions (again) are:

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

Presumably, when I deserialise my object, I should use the
ConvertToDataSet method of the DataSetSurrogate property that
I get back to produce the original DataSet, right?

TIA,

Akin

"Greg Young" <gr********@planetbeach.com> wrote in message
news:e0**************@TK2MSFTNGP11.phx.gbl...
this should help.

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

Cheers,

Greg

"Wild Wind" <no****@blackhole.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 DataSetSurrogate
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 DataSetSurrogate in my object
and pass the DataSet object in my class to this DataSetSurrogate's
constructor? If so, how do I stop the existing DataSet from being
serialized?

Presumably, when I deserialise my object, I should use the
ConvertToDataSet method of the DataSetSurrogate 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
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...
2
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...
11
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...
14
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...
3
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...
11
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...
1
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...
8
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...
1
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...

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.