Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Avoid XML element if value is null

Last post 03-30-2008 3:34 PM by yr. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-29-2008 1:51 AM

    • yr
    • Top 500 Contributor
    • Joined on 06-01-2007
    • United States
    • Member
    • Points 345

    Avoid XML element if value is null

    Hi,

    I am writing xml file from sql server database(Stored Proc) using Xml text writer class ,i

    My query is ,If database  datacolumn value has" null" then ,i dont want to show null element in xml file

    means i dont need particular end element in xml file

     

    example:

    1.<ID>1908</ID>
      <LOCALID>0123456789</LOCALID>
      <Sname>1660</Sname>
      <State>NJ</State>
      <Zip>30824</Zip> 

    If State value is null

    2.<ID>1908</ID>
      <LOCALID>0123456789</LOCALID>
      <Sname>1660</Sname>
        <Zip>30824</Zip>

    I wanted out put like 2 xml file.Please suggest.

    Thanks in advance!!!.

    • Post Points: 5
  • 03-30-2008 3:34 PM In reply to

    • yr
    • Top 500 Contributor
    • Joined on 06-01-2007
    • United States
    • Member
    • Points 345

    Re: Avoid XML element if value is null

    Please reply anyone ASAP.

    • Post Points: 5
Page 1 of 1 (2 items)