Click here to Skip to main content
15,906,463 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everybody,
In the Dataset,some columns are empty.I want those columns in the output XMl.I am using Dataset.getxml() and Loadxml to convert it in to xml document.
Please suggest me if you have any solution of this problem..

Example:
Consider my dataset is as below:
<firstname>SUGATO</firstname>
<middlename></middlename>
<lastname>PAL</lastname>

If i use dataset.getxml then i will get

<firstname>SUGATO</firstname>
<lastname>PAL</lastname>

the output xml will miss <middlename></middlename> node.
I want this <middlename> also in my output xml

Appreciate your Help.
Posted
Updated 14-Apr-11 2:02am
v3

1 solution

The
Dataset.GetXML()
returns string. You can apply to your condition something like this.

if (ds.GetXml() != string.Empty) {
   //do your code here...
}
else {
   //ignore
}
 
Share this answer
 
Comments
Sugato Pal 14-Apr-11 7:01am    
My intension is to have those blank /empty nodes in the xml doccument.I didnt get ur point.
Pong D. Panda 14-Apr-11 7:15am    
Then you need to rephrase your title.
Sugato Pal 14-Apr-11 8:02am    
Thanks for ur suggestion.i modified the title..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900