473,468 Members | 1,358 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XML Serializing one object in a collection

sam
I have a collection of vb.net objects with LoadXML and SaveXML functions
which use XML serialization to persist the collection.

Is it possible to Update one single object in the collection at a time? Can
I have a SaveXML function on my objects that will persist the object to a
specific node in the collection's xml? Rather than having to overwrite the
entire file when I only want to update one object node.

Sorry if I'm not being clear enough, it's difficult to describe.

Thanks

Sam
Nov 11 '05 #1
2 2738
I don't think there is an easy way to update the middle of an XML file
programmatically without saving the entire file again using just XML centric
APIs. Perhaps using the classes in the System.IO namespace but then that may
not be a trivial affair depending on how complex the edits you are trying to
make are.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"sam" <IN*****@NOSPAM.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
I have a collection of vb.net objects with LoadXML and SaveXML functions
which use XML serialization to persist the collection.

Is it possible to Update one single object in the collection at a time? Can I have a SaveXML function on my objects that will persist the object to a
specific node in the collection's xml? Rather than having to overwrite the
entire file when I only want to update one object node.

Sorry if I'm not being clear enough, it's difficult to describe.

Thanks

Sam

Nov 11 '05 #2
Thanks, you put the issues better than I did. I think I'm gonna look into
doing it using XPath

thanks again

sam

"SQL Server Development Team" <sq****@microsoft.com> wrote in message
news:em*************@TK2MSFTNGP12.phx.gbl...
I don't think there is an easy way to update the middle of an XML file
programmatically without saving the entire file again using just XML centric APIs. Perhaps using the classes in the System.IO namespace but then that may not be a trivial affair depending on how complex the edits you are trying to make are.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"sam" <IN*****@NOSPAM.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
I have a collection of vb.net objects with LoadXML and SaveXML functions
which use XML serialization to persist the collection.

Is it possible to Update one single object in the collection at a time?

Can
I have a SaveXML function on my objects that will persist the object to a specific node in the collection's xml? Rather than having to overwrite the entire file when I only want to update one object node.

Sorry if I'm not being clear enough, it's difficult to describe.

Thanks

Sam


Nov 11 '05 #3

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

Similar topics

5
by: Jeff Bunting | last post by:
I'm trying to serialize a class I have and have been getting: An unhandled exception of type 'System.InvalidOperationException' occurred in system.xml.dll There was an error reflecting type...
1
by: dotNetDave | last post by:
I'm trying to create xml seriaizable collection class (below), but the xml keeps coming out wrong. In the resulting xml from the web service (below) the "ArrayOfAlarmProcessor" tag should really be...
1
by: Carl Gilbert | last post by:
Hi I am trying to serialize a collection of GUIDs by overriding the serialize function on a diagram component I am using. The following code sucessfully serializes a single GUID: Public...
3
by: Amy L. | last post by:
I am using the xml serializer to serialize the objects out of a collection into a file. The object that is being serialized is a class in my application. When I serialize my class it produces the...
0
by: JackRazz | last post by:
I'm trying to serialize a collection to a file stream by serializing each object individually. The code below works fine with the BinaryFormatter, but the SoapFormatter reads the first object and...
0
by: Jordan Bowness | last post by:
I make a similar post in another newsgroup, but this example is simplified somewhat. I have a component (cmpMyComponent) with 2 properties. The 1st property is a string value (Description) and...
3
by: axr | last post by:
Having trouble with Serilization of objects that contain members which are of type Interface eg public class SomeClass { ISomeInterface1 itf1; ClassType1 ct1; ISomeInterface2 itf2;
1
by: falcon198198 | last post by:
Greetings: I was hoping for some advice on an application. Here is what I am working on: Basically I have a bigger application that is having a printing problem making multiple copies of a pdf...
1
by: Karthik1979 | last post by:
I have a custom class inherited from List<T> collection. Along with the base class functionality, I have included my additional properties. When serializing, only the base class items are serialized...
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
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
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...
0
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,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.