Dataset.GetXML() method doesn't Return Null Values. Any Solution?

  • Thread starter Thread starter Nanda
  • Start date Start date
N

Nanda

Hi All,

Thanks for u r Valuable postings.
Here is a Problem for me.

I need to reprsent the NULL value of a column in Database in an XML
File as follows.

<Employees>
<Employee>
<Name>John</Name>
</Addr>
<City>NewYork</City>
</Employee>
</Employees>

Here </Addr> represents a null field in Database.
But using Dataset.GetXML() method I am getting the XML O/p as follows.
<Employees>
<Employee>
<Name>John</Name>
<City>NewYork</City>
</Employee>
</Employees>

Can Any body help me from this situation?
Thanks in Advance
Regards
Nanda
 
Hi,

This is because it is containing NULL (DBNull.Value) - it is being
ignored.
Maybe, you can traverse for column having DBNull.Value & make it blank

Then, I guess it should emit XML the way you want

HTH
Kalpesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top