473,789 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Serializing Complex Objects

Hello,

Does anyone kow of any good examples or documents that talk about
serializing complex objects and object graphs to XML. Basically I would like
to have a class that references other classes etc and I'd like to serialize
the whole thing...

Many thanks...

Martin
Nov 22 '05 #1
2 1469
Hi

You can use the XMLSerializer class to do this:
System.Xml.Seri alization.XmlSe rializer ser = new
System.Xml.Seri alization.XmlSe rializer(myType );

ser.Serialize(m yTextWriter, myObject);
Greetz
Jan

"Martin. D. Waller" <ma***********@ beeb.net> wrote in message
news:u4******** ******@tk2msftn gp13.phx.gbl...
Hello,

Does anyone kow of any good examples or documents that talk about
serializing complex objects and object graphs to XML. Basically I would like to have a class that references other classes etc and I'd like to serialize the whole thing...

Many thanks...

Martin

Nov 22 '05 #2
Many thanks..

Martin

"Jan Tielens" <ja*@no.spam.pl ease.leadit.be> wrote in message
news:#q******** ******@tk2msftn gp13.phx.gbl...
Hi

You can use the XMLSerializer class to do this:
System.Xml.Seri alization.XmlSe rializer ser = new
System.Xml.Seri alization.XmlSe rializer(myType );

ser.Serialize(m yTextWriter, myObject);
Greetz
Jan

"Martin. D. Waller" <ma***********@ beeb.net> wrote in message
news:u4******** ******@tk2msftn gp13.phx.gbl...
Hello,

Does anyone kow of any good examples or documents that talk about
serializing complex objects and object graphs to XML. Basically I would

like
to have a class that references other classes etc and I'd like to

serialize
the whole thing...

Many thanks...

Martin


Nov 22 '05 #3

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

Similar topics

2
332
by: Martin. D. Waller | last post by:
Hello, Does anyone kow of any good examples or documents that talk about serializing complex objects and object graphs to XML. Basically I would like to have a class that references other classes etc and I'd like to serialize the whole thing... Many thanks... Martin
2
2768
by: sam | last post by:
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...
1
2088
by: Ivo Bronsveld | last post by:
All, I have quite a challenging task ahead of me. I need to write an object model (for code access) based on a schema, which cannot be made into a dataset because of it's complexity. So I created a couple of objects and serializing it into XML based upon the schema works perfectly. The XML / Schema looks something like this:
2
3524
by: Tobias Zimmergren | last post by:
Hi, just wondering what serializing really is, and howto use it? Thanks. Tobias __________________________________________________________________ Tobias ICQ#: 55986339 Current ICQ status: + More ways to contact me __________________________________________________________________
4
3621
by: Dave Veeneman | last post by:
When does serializing objects make more sense than persisting them to a database? I'm new to object serialization, and I'm trying to get a feel for when to use it. Here is an example: I'm writing an accounting application. I have a chart of accounts in the form of a containment hierarchy. A GeneralLedger contains a number of Accounts, and each of these Accounts can contain a Aubledger, which contains its own Accounts, and so on. The...
8
1399
by: Joe | last post by:
Hello All: Say I have a solution with two projects (Project1 and Project2) and each project contains a class (Project1 contains Class1 and Project2 contains Class2). The projects don't reference each other. Here's my question: can I serialize Class1 and use the serialized XML in Class2? How would Class2 de-serialize the XML to retrieve the Class1's properties? I don't see how I can do this since Project2 doesn't even know about...
2
1619
by: Dennis | last post by:
Does anyone know why this code gives an error: <serializeable> public structure TestSerialize anumber as integer astring as string end strucuture Dim t As TestSerialize Dim formatter As New BinaryFormatter Dim s As New MemoryStream
1
1182
by: Chris Dunaway | last post by:
Consider the following simple class: <Serializable()> _ Public Class SimpleClass Private m_AString As String Private m_AByteArray As Byte() Public Property AString() As String . . . End Property
2
331
by: Charles Law | last post by:
I have a complex object that I am serializing, and I would like to omit elements that have a default value. For example, if I have a class as follows Public Class Test Private m_Name As String = "George" Private m_Active As Boolean = False Private m_Address As String
5
4220
by: | last post by:
I've got a basic "chat" infrastructure that can send objects across the wire, but I'm running into a few issues with trying to send multiple messages and things behaving differently in debug and release... Is there anyone out there that considers themselves a threading / sockets / serialization guru? Not sure if it's appropriate to post an entire project here and the issues discussion is probably a bit too complex for newsgroup back and...
0
9656
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
9499
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
10374
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
10177
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...
0
9969
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
5405
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
5540
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2898
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.