Solved

use xml to populate array

Posted on 2004-08-01
3
306 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

688 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