473,396 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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?
Aug 4 '06 #1
2 1311

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]

Aug 4 '06 #2
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.
"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]

Aug 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: xmail123 | last post by:
Hi, As was pointed out whatever you return from a WebMethod needs to be serializable to SOAP. An ArrayList is not serializable. I will be needing to return other data types from web methods. ...
0
by: si | last post by:
I'm very new to using C# in an ASP.NET application, and am used to using the ADO GetRows() method to quickly dump data into a multidimensional array in classic ASP. I am trying to work through...
1
by: davehunt | last post by:
Hi folks, New C# programmer here. I am reading some CSV data from a file into an ArrayList. I want to get the data from the ArrayList into a 2-dimensional array. I see a few references to...
4
by: theo | last post by:
Program flow...load file,then extract the xml text tags from the file,then the number of Xml tags retrieved from the file determines the number of dropdownlist controls instanciated in the...
9
by: shadow.demon | last post by:
G'day, I've separated my database calls into a separate dll, and return results from any database calls as a SqlDataReader (because of SQL Server use, it's nice and fast). However I'd like to be...
9
by: Ben R. | last post by:
Hi guys, I've got a DB table of timecards with these fields in the table: ID (Int) UserID (Int) DateWorked (DateTime) HoursWorkedOnThatDate (Double) I'd like to display a grid, with...
3
by: zaiena | last post by:
hello, i'm tyring to add data to appened query using button but i've this message: "you are about to appened 1 row (s) ". so how can i solve this problem as sooon as possible please.
2
by: zaiena | last post by:
ho to all, i have made an project using ms access 2007, in my database i use some append queries to add data,and open report the query run when i'm click a button,in the first it works will but...
1
by: =?Utf-8?B?SkI=?= | last post by:
Hello My pgm1 (User Interface Level) passes an empty ArrayList to pgm2 (Business Logic Level). pgm2 then calls pgm3 (Data Access Level) to populate the ArrayList. Question1: When pgm2 gets...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.