[2008] Vb.net using XML file
elow everyone..its me again..Could anyone tell me how to load data on my label. I have here xml format data and I want it to import on my label of my winforms. Could anyone of you help me to put this into one label? Need help guys..Thanks and have a nice day!
Here is my XML data to be loaded on the label:
Code:
<?xml version="1.0" standalone="yes" ?>
- <SaleMonitor>
- <SalesMonitoring>
<StoreName>PPC-RIZAL</StoreName>
<_10Qty>1624</_10Qty>
<_10LCP>12966263.0000</_10LCP>
<_20Qty>32</_20Qty>
<_20LCP>1914005.0000</_20LCP>
<_50Qty>624</_50Qty>
<_50LCP>3041846.0000</_50LCP>
<_70Qty>134</_70Qty>
<_70LCP>1123263.0000</_70LCP>
<_30Qty>0</_30Qty>
<_30LCP>0.0000</_30LCP>
<DateXtracted>2008-06-18T15:42:25.543+08:00</DateXtracted>
</SalesMonitoring>
- <SalesMonitoring>
<StoreName>BAJADA</StoreName>
<_10Qty>607</_10Qty>
<_10LCP>5765876.0000</_10LCP>
<_20Qty>87</_20Qty>
<_20LCP>5741244.0000</_20LCP>
<_50Qty>0</_50Qty>
<_50LCP>0.0000</_50LCP>
<_70Qty>71</_70Qty>
<_70LCP>567380.0000</_70LCP>
<_30Qty>0</_30Qty>
<_30LCP>0.0000</_30LCP>
<DateXtracted>2008-06-18T15:30:39.373+08:00</DateXtracted>
</SalesMonitoring>
- </SaleMonitor>
Re: [2008] Vb.net using XML file
first of all you have to import namespace
Imports System.xml
then
Code:
Dim xmldoc As New XmlDocument()
xmldoc.Load("your file name with path c:\.....l")
Dim BookNodes As XmlNodeList
Dim BookNode As XmlNode
Dim BookAttList As XmlNamedNodeMap
Dim qohAttribute As XmlAttribute
BookNodes = xmldoc.GetElementsByTagName("Book")
For Each BookNode In BookNodes
BookAttList = BookNode.Attributes
qohAttribute = xmldoc.CreateAttribute("qoh")
qohAttribute.InnerText = ""
BookAttList.SetNamedItem(qohAttribute)
Next
xmldoc.Save("save file location with name c:\books.xml")