|
-
Dec 21st, 2006, 04:49 AM
#1
Thread Starter
Lively Member
simple xml read
hello,
I have a very simple xml file
VB Code:
<?xml version="1.0" ?>
- <!-- This Is A List of Menu items
-->
- <MyItems>
<ITEM TITLE="one" VALUE="one" />
<ITEM TITLE="two" VALUE="two" />
</MyItems>
I would like to read each item within the file and add them to menu items,
I think in .net 2.0 to use the xmlReader Class,
could someone pelase suggest how to use that class in this situation, sorry im used to using the DOM vb6 object for this sort of thing.
Many Thanks.
-
Dec 26th, 2006, 11:30 PM
#2
Re: simple xml read
Try the dataset object for read xml for you, I find it useful.
VB Code:
Protected Sub BindItems()
'read xml into dataset
Dim myDs As New DataSet
myDs.ReadXml("C:\Test.xml")
'bind data to listbox
ListBox1.DisplayMember = "TITLE"
ListBox1.ValueMember = "VALUE"
ListBox1.DataSource = myDs.Tables(0)
End Sub
-
Dec 28th, 2006, 04:17 AM
#3
Thread Starter
Lively Member
Re: simple xml read
ops sorry this is asp.net using VB, thanks for the answer but how would i write this in the asp.net enviroment?
thanks again.
-
Dec 28th, 2006, 10:39 AM
#4
Re: simple xml read
Just to clarify that is vb. When you say you want to add them to menu items, what do you mean?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|