how to appened data into a arraylist?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i got a program with a dropdown combobox that will go and grab data off of a
xml file that was selected from dropdown after the user chose a file then
click select button it add data into an arraylist, i want the user to be able
to appened more data if they select another file and so on.

how do i do it?
 
dotnetnoob said:
i got a program with a dropdown combobox that will go and grab data off of a
xml file that was selected from dropdown after the user chose a file then
click select button it add data into an arraylist, i want the user to be able
to appened more data if they select another file and so on.

how do i do it?

Dim myArrayList As New ArrayList
myArrayList.Add (WhateverDataObjectHere)
myArrayList.Add (AnotherDataObjectHere)
....

Call the arraylists add method.
 
Dim nlEqObjName As Xml.XmlNodeList =
doc.SelectNodes("/AutomationControl/EquipmentObjects/EquipmentObject/GeneralProperties/@ObjectName")
Dim nEqObjName As Xml.XmlNode
For Each nEqObjName In nlEqObjName
arlsEqObjName.Add(nEqObjName.InnerText)
Next
Dim nlEqObjInstNum As Xml.XmlNodeList =
doc.SelectNodes("/AutomationControl/EquipmentObjects/EquipmentObject/GeneralProperties/@InstanceNumber")
Dim nEqObjInstNum As Xml.XmlNode
For Each nEqObjInstNum In nlEqObjInstNum
arlsEqObjInstNum.Add(nEqObjInstNum.InnerText)
Next

when the user click the select button again after chosing another xml file,
the pervious selected data from the pervious xml files are replace when
calling the above sub. how do i retain the pervious data and append the new
data.
 
Back
Top