Solved

use xml to populate array

Posted on 2004-08-01
3
283 Views
Last Modified: 2010-04-06
I know how to populate a dataset using xml.
How do I populate a 2 dimensional array with the contents of the xml file (aspx vb.net) please?
0
Comment
Question by:QPR
3 Comments
 
LVL 4

Accepted Solution

by:
daletian earned 50 total points
ID: 11703439
use this code snippet to load you XML file

----------------------------------------------------------------------------------------------
Dim dataSet1 As New DataSet
Dim filePath As String

filePath = "Complete path where you saved the XML file"
dataSet1.ReadXml(filePath)
----------------------------------------------------------------------------------------------

you can the bind it to any control you wish to use to display the data

eg.       dataGrid1.DataSource = objDataSet.Tables(0).DefaultView
            dataGrid1.DataBind()
0
 
LVL 29

Author Comment

by:QPR
ID: 11710500
Thanks daletian.
I've got the xml values into a dataset no problem but how do I then put the values into a 2 dimensional array?
0
 

Expert Comment

by:BodeTech
ID: 11735571
Naaaw, first loop through to count

Once counted, redim

then .MoveFirst

Then loop through to populate

array(i,0) = foo
and
array(i,1) = bar
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question