|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to appened data into a arraylist?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 wrote:
> i got a program with a dropdown combobox that will go and grab data off of a Dim myArrayList As New ArrayList> 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? myArrayList.Add (WhateverDataObjectHere) myArrayList.Add (AnotherDataObjectHere) .... Call the arraylists add method. -- Tom Shelton [MVP] 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. Show quoteHide quote "Tom Shelton" wrote: > > dotnetnoob wrote: > > 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. > > -- > Tom Shelton [MVP] > > |
|||||||||||||||||||||||