We help IT Professionals succeed at work.
Get Started

Help with saving data to xml file

Last Modified: 2012-08-21

I am trying to save data to Manufacturer_ID but for some reason the data does not save, any ideas what is wrong? I was able to verify the value of searchIdManufacturer exist by using  MsgBox(searchIdManufacturer) but the value is not save in LibkA.xml. Further below is an example of the LinkA.xml fiule.

Dim xda As New Xml.XmlDocument
   Dim xna As Xml.XmlNode

            xna = xda.SelectSingleNode("/Root/LinkA[LinkAID='" & dtTable.Rows(CurrentIndex).Item("LinkID2") & "']")
            xna.SelectSingleNode("Manufacturer_ID").InnerText = searchIdManufacturer

Dim anadd As String
            anadd = MsgBox("Are you sure you want to save your changes?", MsgBoxStyle.YesNo, "Warning before Attempting to Save changes")
            If anadd = MsgBoxResult.Yes Then
        Dim Msg As String = "All Changes Have Been Saved"
                ScriptManager.RegisterStartupScript(Me.Page, Me.[GetType](), "temp", "<script type='text/javascript'>alert('" & Msg & "');</script>", False)
            End If



The new value of Manufacture_ID is 20 but it doesn't replace the value of 1. I think something must be wrong with the following code:

 xna = xda.SelectSingleNode("/Root/LinkA[LinkAID='" & dtTable.Rows(CurrentIndex).Item("LinkID2") & "']")

But still can't figure it out.
Watch Question
Infotrakker Software
Most Valuable Expert 2012
Top Expert 2014
This problem has been solved!
Unlock 1 Answer and 22 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE