G
Guest
I know I have been asking LOTS of xml questions and I really apprecaite all
the help.
Here is my XML file
<?xml version="1.0" encoding="utf-8" ?>
<products>
<!-- Repeat the structure below for each product. -->
<product>
<id>CP-90, T-32</id>
<company>Carwell</company>
<address>Street Address</address>
<city>City</city>
<state>State</state>
<zip>Zip</zip>
</product>
<!-- Next product here-->
</products>
I am loading the doc in memory using xmlDocument
Dim xmlFile As String = xmlLocation()
Dim xmlDoc As XmlDocument
Private Sub Products_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
xmlDoc = New XmlDocument
xmlDoc.Load(xmlFile)
End Sub
Here is when my problem starts. I have a form with all the information that
I needed "appended" to the XMLdoc (in memory). I tried
Private Sub AddProduct(ByVal node As XmlNode)
Dim xmlProductName = txtProduct.Text
Dim xmlCompanyName = txtCompany.Text
Dim xmlAddress = txtAddress.Text
Dim xmlCity = txtCity.Text
Dim xmlState = cmboState.Text
Dim xmlZip = txtZip.Text
node.AppendChild(xmlProductName)
node.AppendChild(xmlCompanyName)
node.AppendChild(xmlAddress)
node.AppendChild(xmlCity)
node.AppendChild(xmlState)
node.AppendChild(xmlZip)
End Sub
But I am really confused on what node to pass. Any help would be apprciated.
the help.
Here is my XML file
<?xml version="1.0" encoding="utf-8" ?>
<products>
<!-- Repeat the structure below for each product. -->
<product>
<id>CP-90, T-32</id>
<company>Carwell</company>
<address>Street Address</address>
<city>City</city>
<state>State</state>
<zip>Zip</zip>
</product>
<!-- Next product here-->
</products>
I am loading the doc in memory using xmlDocument
Dim xmlFile As String = xmlLocation()
Dim xmlDoc As XmlDocument
Private Sub Products_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
xmlDoc = New XmlDocument
xmlDoc.Load(xmlFile)
End Sub
Here is when my problem starts. I have a form with all the information that
I needed "appended" to the XMLdoc (in memory). I tried
Private Sub AddProduct(ByVal node As XmlNode)
Dim xmlProductName = txtProduct.Text
Dim xmlCompanyName = txtCompany.Text
Dim xmlAddress = txtAddress.Text
Dim xmlCity = txtCity.Text
Dim xmlState = cmboState.Text
Dim xmlZip = txtZip.Text
node.AppendChild(xmlProductName)
node.AppendChild(xmlCompanyName)
node.AppendChild(xmlAddress)
node.AppendChild(xmlCity)
node.AppendChild(xmlState)
node.AppendChild(xmlZip)
End Sub
But I am really confused on what node to pass. Any help would be apprciated.