Click here to Skip to main content
15,905,967 members
Home / Discussions / C#
   

C#

 
GeneralRe: Best practice for ADO.NET and C# Pin
matbuk16-Jul-07 23:55
matbuk16-Jul-07 23:55 
QuestionCopying one class to another Pin
Berlus16-Jul-07 22:54
Berlus16-Jul-07 22:54 
AnswerRe: Copying one class to another Pin
Martin#16-Jul-07 23:00
Martin#16-Jul-07 23:00 
QuestionText on Video using DirectX Pin
Sukhjinder_K16-Jul-07 22:46
Sukhjinder_K16-Jul-07 22:46 
AnswerRe: Text on Video using DirectX Pin
Eduard Keilholz16-Jul-07 23:44
Eduard Keilholz16-Jul-07 23:44 
QuestionXML Serialization Pin
blackjack215016-Jul-07 22:46
blackjack215016-Jul-07 22:46 
AnswerRe: XML Serialization Pin
J4amieC16-Jul-07 23:36
J4amieC16-Jul-07 23:36 
GeneralRe: XML Serialization Pin
blackjack215017-Jul-07 1:03
blackjack215017-Jul-07 1:03 
Thanks for the interest.

But it's not about attributes. It's about the value itself.

Let me give you an example:

Say I have the simple class:

class Human
{
public string name;
public int age;
public int height;
public char gender;
}

If I declare a "Human" variable and give values to some of the fields, but not all:

Human John = new Human();
John.name = "John Stevens";
John.age = 23;

I don't give any value to the height and gender fields.
After that I serialize this class to XML.
The output will be:

<xml...>
<Human>
<name>John Stevens</name>
<age>23</age>
</Human>

You notice that there are no tags for height and gender because these values were not initialized.

Bottom line:
Is there a way to get this output xml for the same chain of events as described above?

<xml...>
<Human>
<name>John Stevens</name>
<age>23</age>
<height />
<gender />
</Human>

Thanks.
QuestionSystem Files in Deployment Pin
RoyRose7816-Jul-07 22:30
RoyRose7816-Jul-07 22:30 
AnswerRe: System Files in Deployment Pin
Colin Angus Mackay16-Jul-07 22:33
Colin Angus Mackay16-Jul-07 22:33 
QuestionRDLC report problem Pin
manoj_ce16-Jul-07 22:17
manoj_ce16-Jul-07 22:17 
QuestionCrystal Report (beginner) Pin
T.EDY16-Jul-07 21:58
T.EDY16-Jul-07 21:58 
Questiondrawing shape that is allowed to drag and drop Pin
cyn816-Jul-07 20:17
cyn816-Jul-07 20:17 
AnswerRe: drawing shape that is allowed to drag and drop Pin
Bert delaVega17-Jul-07 6:18
Bert delaVega17-Jul-07 6:18 
QuestionHow to changeIME mode Pin
iprasad00716-Jul-07 19:58
iprasad00716-Jul-07 19:58 
AnswerRe: How to changeIME mode Pin
Eduard Keilholz16-Jul-07 21:55
Eduard Keilholz16-Jul-07 21:55 
GeneralRe: How to changeIME mode Pin
iprasad00717-Jul-07 0:01
iprasad00717-Jul-07 0:01 
AnswerRe: How to changeIME mode Pin
originSH16-Jul-07 22:00
originSH16-Jul-07 22:00 
GeneralRe: How to changeIME mode Pin
iprasad00717-Jul-07 0:11
iprasad00717-Jul-07 0:11 
GeneralRe: How to changeIME mode Pin
originSH17-Jul-07 0:26
originSH17-Jul-07 0:26 
QuestionImages+popup menu Pin
razanabanu16-Jul-07 19:33
razanabanu16-Jul-07 19:33 
AnswerRe: Images+popup menu Pin
Martin#16-Jul-07 19:56
Martin#16-Jul-07 19:56 
GeneralRe: Images+popup menu Pin
razanabanu16-Jul-07 20:52
razanabanu16-Jul-07 20:52 
Questionwriting combo box items Pin
Xmen Real 16-Jul-07 19:26
professional Xmen Real 16-Jul-07 19:26 
AnswerRe: writing combo box items Pin
Martin#16-Jul-07 19:52
Martin#16-Jul-07 19:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.