I'm having an issue relating a xml document, i want to show null values ( they dont show up on xml structure ) as an empty string or something,
Example:
="1.0"="yes"
<SerialisedData>
<xs:schema id="SerialisedData" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop">
<xs:element name="SerialisedData" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table1" msprop:BaseTable.0="TABLE_NAME" msprop:BaseSchema="SCHEMA_NAME">
<xs:complexType>
<xs:sequence>
<xs:element name="FILE" msprop:OraDbType="126" msprop:BaseColumn="FILE" type="xs:string" minOccurs="0" />
<xs:element name="BBid" msprop:OraDbType="113" msprop:BaseColumn="BBid" type="xs:long" minOccurs="0" />
<xs:element name="trnid" msprop:OraDbType="113" msprop:BaseColumn="trnid" type="xs:long" minOccurs="0" />
<xs:element name="stnid" msprop:OraDbType="113" msprop:BaseColumn="stnid" type="xs:long" minOccurs="0" />
<xs:element name="PIGGYBACK" msprop:OraDbType="126" msprop:BaseColumn="PIGGYBACK" type="xs:string" minOccurs="0" />
<xs:element name="PAY_TYPE" msprop:OraDbType="126" msprop:BaseColumn="PAY_TYPE" type="xs:string" minOccurs="0" />
<xs:element name="AMT" msprop:OraDbType="107" msprop:BaseColumn="AMT" type="xs:decimal" minOccurs="0" />
<xs:element name="POSNUMBER" msprop:OraDbType="126" msprop:BaseColumn="POSNUMBER" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<Table1>
<BBid>503101</BBid>
<trnid>1377982613101</trnid>
<stnid>13100</stnid>
<PAY_TYPE>01</PAY_TYPE>
<AMT>10000</AMT>
<POSNUMBER>CCT001</POSNUMBER>
</Table1>
<Table1>
<BBid>573101</BBid>
<trnid>1377982723101</trnid>
<stnid>13100</stnid>
<PAY_TYPE>01</PAY_TYPE>
<AMT>1000</AMT>
<POSNUMBER>CCT001</POSNUMBER>
</Table1>
I want to display like this (including the PIGGYBACK column):
<Table1>
<BBid>573101</BBid>
<trnid>1377982763101</trnid>
<stnid>13100</stnid>
<PAY_TYPE>01</PAY_TYPE>
<AMT>9000</AMT>
<POSNUMBER>CCT001</POSNUMBER>
<PIGGYBACK></PIGGYBACK>
</Table1>
<Table1>
<BBid>573101</BBid>
<trnid>1377982763101</trnid>
<stnid>13100</stnid>
<PAY_TYPE>01</PAY_TYPE>
<AMT>9000</AMT>
<POSNUMBER>CCT001</POSNUMBER>
<PIGGYBACK></PIGGYBACK>
</Table1>
My
PIGGYBACK
column contains/returns
null
from the view/table (
DataSet
) and I am referencing this column in my code further down.
I use the following to Write the XML file:
DataSet ds = new DataSet("SerialisedData")
ds.WriteXml(@"C:\FileName.XML", XmlWriteMode.WriteSchema)
To Read the file:
DataSet ds = new DataSet("SerialisedData")
ds.ReadXml(@"C:\FileName.XML", XmlReadMode.ReadSchema)
How can I do this?
Thank you in advance for your help.
Thanks!