• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 317
  • Last Modified:

use xml to populate array

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
QPR
Asked:
QPR
1 Solution
 
daletianCommented:
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
 
QPRAuthor Commented:
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
 
BodeTechCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now