473,804 Members | 3,469 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Serialize multiple object in the same XML file

Hello,

I'm looking for a best way to serialize multiple / different object in the
same XML file, and of course, how can i deserialize it.

Actualy, when i serialize the first object in XML file, it work fine,
But the second erase the entry of the first object !!!

Thank's by advance

Gislain

Nov 17 '05 #1
3 3250
Hello Gislain,

Create a collection of objects and serialize it to a xml file. WHen you deserialize,
you get same collection back.

Mihir Solanki
http://www.mihirsolanki.com
Hello,

I'm looking for a best way to serialize multiple / different object in
the same XML file, and of course, how can i deserialize it.

Actualy, when i serialize the first object in XML file, it work fine,
But the second erase the entry of the first object !!!

Thank's by advance

Gislain

Nov 17 '05 #2
Hi,

Does it work with different object in the same collection ?

Thank's

Gislain.

"Mihir Solanki" <mi**********@h otmail.com> wrote in message
news:19******** *************** **@msnews.micro soft.com...
Hello Gislain,

Create a collection of objects and serialize it to a xml file. WHen you
deserialize, you get same collection back.
Mihir Solanki
http://www.mihirsolanki.com
Hello,

I'm looking for a best way to serialize multiple / different object in
the same XML file, and of course, how can i deserialize it.

Actualy, when i serialize the first object in XML file, it work fine,
But the second erase the entry of the first object !!!

Thank's by advance

Gislain


Nov 17 '05 #3
The way I am using is creating an class which has all the objects I want
to serialize.

In the construct, I will read each node representing each object ,and
deserilze one by one.

I have a ToXml method, and in which I will serialize one by one.

There may be better methods available.

John

Gislain wrote:
Hi,

Does it work with different object in the same collection ?

Thank's

Gislain.

"Mihir Solanki" <mi**********@h otmail.com> wrote in message
news:19******** *************** **@msnews.micro soft.com...
Hello Gislain,

Create a collection of objects and serialize it to a xml file. WHen you
deserialize , you get same collection back.
Mihir Solanki
http://www.mihirsolanki.com

Hello,

I'm looking for a best way to serialize multiple / different object in
the same XML file, and of course, how can i deserialize it.

Actualy, when i serialize the first object in XML file, it work fine,
But the second erase the entry of the first object !!!

Thank's by advance

Gislain



Nov 17 '05 #4

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

Similar topics

1
3065
by: Luiz Rafael Fernandes | last post by:
Hi... i try to serialize a object inherited of label control, as follow: //definition public class WinLabel : System.Windows.Forms.Label { public WinLabel() {} }
4
2058
by: veereshai | last post by:
i want to copy the functions from my source file into a new file...and convert each function into a new object file by compiling it. now, i want to invoke the function using the object file i have created and not by invoking the original function(i.e delete the part which has the function and then try to invoke the same function by including the object file into my source code). Is this possible?
5
3697
by: Julia | last post by:
Hi, I need to serialize an object in such a way that it can be passed as parameter in a URL http://www.domain.com?object=%d793btng.... I did some reading and I came to the conclusion that I need to create a custom formatter and implements the IFormatter interface
0
823
by: deko | last post by:
I'm building an app that will snycronize user-selected directories. In the UI, a user can select several folder pairs for syncronization and schedule it for later. So, I want to store the paths to the selected directories (and other options) to an XML file. I'm new at this and not sure what is the best way to do this - I assume I need to serialize the object that contains the data and serialze it, then write it to a file... ? Does this...
0
1339
by: Redowl | last post by:
Hi, I am trying to serialize a business object using xml generated by a FOR XML query and the resulting xml has no root element. I have created my business object using the schema returned from my query's XMLDATA and the xsd tool. However, when i try to serialize the object only the first element gets serialized and I have to use MoveToElement to get all the elements. This is my original code which I am passing in a SqlCommand...
0
1063
by: amitp | last post by:
Can anyone help me out in this? I want to append multiple RTF file into one RTF file. I tried using 'streamwriter', the resulting file size becomes big and when i open it, it is the original i.e the first RTF file only and not the appended one. But i open the file with notepad it looks appended. I've supplied my code below . I've searched thru internet a lot but didn't get anything. So if anybody hav a solution plz help me out. I'll explain...
5
519
by: jayapal | last post by:
Hi all, We have large code on which we are solving the bugs. For every bug we change the code part either add or delete some of the code part. More is adding the code part and very less is deleting the code. But the question is , after build the object file( changed code) size is less than the object file ( unchanged code)???. As we increased the lines of code the object file size should be increased but here it
1
2149
by: goelamit1982 | last post by:
How to Read multiple text file using XML and store into the database
2
1499
by: Patrick Sona | last post by:
Hi all! has anyone an idea how to serialize an object to a String without using XMLSerializer? The problem is, that i have to serialize a Hashtable to a String and the XMLSerializer doesn't accept any object that inherits from ICollection. So I have to use the Binary or SoapFormater. But both accept only a Stream and .net has no StringStream. Thanx!
0
9588
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
10085
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
9161
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...
1
7625
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
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
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
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
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
2999
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.