473,385 Members | 1,343 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,385 software developers and data experts.

XML serializer question

Jo
Hi all,

To deserialize the xml string, I need the attribute set to null if it is
missing in the xml stream, instead of seeing
'System.NullReferenceException occured'.

I tried setting XMLAttributeElement(IsNullable=true or false), but I could
not get what I wanted.

Is there any simple way?

TIA,

Jo
Jul 23 '07 #1
1 1958
Jo wrote:
To deserialize the xml string, I need the attribute set to null if it is
missing in the xml stream, instead of seeing
'System.NullReferenceException occured'.

I tried setting XMLAttributeElement(IsNullable=true or false), but I could
not get what I wanted.

Is there any simple way?
Can you post the XML and the class definition that you have?
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jul 24 '07 #2

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

Similar topics

1
by: | last post by:
Hi, When we get generic collections will the serializer change so we dont need to give it a type parameter for collections ? Currently today if we serialize an ArrayList, we have to give it a...
0
by: Mark | last post by:
Hi all, i'm trying to serialize a class. Using the constructor of XmlSerializer i get these (odd?) errors: "File or assembly name goseij9w.dll, or one of its dependencies, was not found"....
1
by: James | last post by:
Hi, I have an array of structures I would like to turn into an XML string using the XML serializer. The problem I am running into is that I get an exception. Depending on what data type I set...
1
by: Marty McDonald | last post by:
I created business entity classes using XSD.exe. In code I've populated my dataset. Now, I want to put that data into the entity class. Do I use DataSet.WriteXml() to a memorystream, then pass...
3
by: Mark | last post by:
Hi all, i'm trying to serialize a class. Using the constructor of XmlSerializer i get these (odd?) errors: "File or assembly name goseij9w.dll, or one of its dependencies, was not found"....
0
by: Albert Jan | last post by:
Hi, I use the XmlSerializer in C# to serialize an object containing an email message to xml. This works often fine, but for some mailmessages the serialization fails with the message 'There was...
6
by: Dave Veeneman | last post by:
Is XML Serialization worth using to persist classes to file? I've been trying for a day to get it to work on some fairly simple classes. what I'm getting back are error messages like "There is an...
6
by: Wilfried Mestdagh | last post by:
Hi, I use this class to save application settings in a xml file. Sometime I have exception error in the Load method, and sometime in the Save method. Is this a bug in NET or is there something I...
8
by: Q. John Chen | last post by:
I have following code: public class Member { public string FirstName; public string LastName; public string GetXml() { StringBuilder sb = new StringBuilder(); XmlSerializer serializer
1
by: hawkeye.parker | last post by:
using .net 1.1 i think i might want to replace the xml serializer which my .Net webservice uses with a custom serializer. anyone know: a) is this possible? b) if so, is it terribly difficult...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.