moone009 0 Junior Poster in Training

I was wondering if anyone knew of a more efficient way to run this? I feel that there has to be a more efficient way.

Thanks

Dim doc As New XmlDocument
        Dim nodes As XmlNodeList
        Dim nodes1 As XmlNodeList
        Dim nodes2 As XmlNodeList
        Dim nodes3 As XmlNodeList
        Dim nodes4 As XmlNodeList
        Dim nodes5 As XmlNodeList
        Dim nodes6 As XmlNodeList
        Dim nodes7 As XmlNodeList
        Dim nodes8 As XmlNodeList
        Dim nodes9 As XmlNodeList
        Dim nodes10 As XmlNodeList
        Dim nodes11 As XmlNodeList
        Dim nodes12 As XmlNodeList
        Dim nodes13 As XmlNodeList
        Dim nodes14 As XmlNodeList
        Dim nodes15 As XmlNodeList
        Dim nodes22 As XmlNodeList


        'paths to the specific settings
        'doc.Load("C:\Users\cmooney\Desktop\Template.xml")
        doc.Load(OpenFile.Text)
        nodes = doc.SelectNodes("program/databaseinfo")
        nodes22 = doc.SelectNodes("program/databaseinfo")
        nodes1 = doc.SelectNodes("program/entities/userinfo")
        nodes2 = doc.SelectNodes("program/entities/lacartsshipto")
        nodes3 = doc.SelectNodes("program/entities/lacartsshipto")
        nodes4 = doc.SelectNodes("program/entities/lacartsshipto/locationid")
        nodes5 = doc.SelectNodes("program/entities/lacartsshipto/locationid")
        nodes6 = doc.SelectNodes("program/entities/lacartsshipto/locationid")
        nodes7 = doc.SelectNodes("program/entities/lacartsshipto/locationid")
        nodes8 = doc.SelectNodes("program/entities/lacartsshipto/locationid")
        nodes9 = doc.SelectNodes("program/entities/lacartsshipto/locationid")
        nodes10 = doc.SelectNodes("program/entities/lacartsshipto/locationid/customerid")
        nodes11 = doc.SelectNodes("program/entities/lacartsshipto/locationid/customerid")
        nodes12 = doc.SelectNodes("program/entities/lacartsshipto/locationid/customerid")
        nodes13 = doc.SelectNodes("program/entities/lacartsshipto/locationid/customerid")
        nodes14 = doc.SelectNodes("program/entities/lacartsshipto/locationid/customerid")
        nodes15 = doc.SelectNodes("program/entities/lacartsshipto/locationid/customerid")


        'conver ProgramShortName to upper
        Dim s As String
        s = Me.ProgramShortName.Text
        s = s.ToUpper
        Me.ProgramShortName.Text = s



        'begin updating xml document 

        'updates Databaseinfo
        Dim counter = 0
        Do Until counter = nodes.Count
            nodes.Item(counter).SelectSingleNode("programshortname").InnerText = ProgramShortName.Text
            counter = counter + 1
        Loop
        Dim counter22 = 0
        Do Until counter = nodes22.Count
            nodes22.Item(counter22).SelectSingleNode("description").InnerText = CityandState.Text
            counter22 = counter22 + 1
        Loop

        'updates lauserinfo
        Dim counter1 = 0
        Do Until counter1 = nodes1.Count
            nodes1.Item(counter1).SelectSingleNode("settingkey").InnerText = ProgramShortName.Text
            counter1 = counter1 + 1
        Loop

        'updates lacartsshipTo
        Dim counter2 = 0
        Do Until counter2 = nodes2.Count
            nodes2.Item(counter2).SelectSingleNode("shiptoid").InnerText = ProgramShortName.Text
            counter2 = counter2 + 1
        Loop
        Dim counter3 = 0
        Do Until counter3 = nodes3.Count
            nodes3.Item(counter3).SelectSingleNode("shiptodescription").InnerText = CityandState.Text
            counter3 = counter3 + 1
        Loop
        Dim counter4 = 0
        Do Until counter4 = nodes4.Count
            nodes4.Item(counter4).SelectSingleNode("description").InnerText = CityandState.Text
            counter4 = counter4 + 1
        Loop
        Dim counter5 = 0
        Do Until counter5 = nodes5.Count
            nodes5.Item(counter5).SelectSingleNode("code").InnerText = CityandState.Text
            counter5 = counter5 + 1
        Loop
        Dim counter6 = 0
        Do Until counter6 = nodes6.Count
            nodes6.Item(counter6).SelectSingleNode("address1").InnerText = Addresstxt.Text
            counter6 = counter6 + 1
        Loop
        Dim counter7 = 0
        Do Until counter7 = nodes7.Count
            nodes7.Item(counter7).SelectSingleNode("city").InnerText = citytxt.Text
            counter7 = counter7 + 1
        Loop
        Dim counter8 = 0
        Do Until counter8 = nodes8.Count
            nodes8.Item(counter8).SelectSingleNode("state").InnerText = statetxt.Text
            counter8 = counter8 + 1
        Loop
        Dim counter9 = 0
        Do Until counter9 = nodes9.Count
            nodes9.Item(counter9).SelectSingleNode("zip").InnerText = ziptxt.Text
            counter9 = counter9 + 1
        Loop

        'updates Customerid
        Dim counter10 = 0
        Do Until counter10 = nodes10.Count
            nodes10.Item(counter10).SelectSingleNode("vicustomerno").InnerText = shipToidtxt.Text
            counter10 = counter10 + 1
        Loop
        Dim counter11 = 0
        Do Until counter11 = nodes11.Count
            nodes11.Item(counter11).SelectSingleNode("vicompanyname").InnerText = CityandState.Text
            counter11 = counter11 + 1
        Loop
        Dim counter12 = 0
        Do Until counter12 = nodes12.Count
            nodes12.Item(counter12).SelectSingleNode("vistreet").InnerText = Addresstxt.Text
            counter12 = counter12 + 1
        Loop
        Dim counter13 = 0
        Do Until counter13 = nodes13.Count
            nodes13.Item(counter13).SelectSingleNode("vicity").InnerText = citytxt.Text
            counter13 = counter13 + 1
        Loop
        Dim counter14 = 0
        Do Until counter14 = nodes14.Count
            nodes14.Item(counter14).SelectSingleNode("vistate").InnerText = statetxt.Text
            counter14 = counter14 + 1
        Loop
        Dim counter15 = 0
        Do Until counter15 = nodes15.Count
            nodes15.Item(counter15).SelectSingleNode("vizip").InnerText = ziptxt.Text
            counter15 = counter15 + 1
        Loop



   



        'save xml document

        doc.Save("C:\" + ProgramShortName.Text + ".xml")
        doc = Nothing
    End Sub