Solved

use xml to populate array

Posted on 2004-08-01
3
290 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

821 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